:octocat: GenericGFPoly::$coefficients: remove property getter in favor of asymmetric visibility

This commit is contained in:
smiley
2026-03-18 02:36:29 +01:00
parent 3f858d71bd
commit a86ce60bd3
2 changed files with 2 additions and 10 deletions
+1 -8
View File
@@ -27,7 +27,7 @@ use function array_fill, array_slice, array_splice, count;
final class GenericGFPoly{
/** @var int[] */
private array $coefficients;
private(set) array $coefficients;
/**
* @param int[] $coefficients array coefficients as ints representing elements of GF(size), arranged
@@ -75,13 +75,6 @@ final class GenericGFPoly{
return $this->coefficients[(count($this->coefficients) - 1 - $degree)];
}
/**
* @return int[]
*/
public function getCoefficients():array{
return $this->coefficients;
}
/**
* @return int $degree of this polynomial
*/
+1 -2
View File
@@ -96,8 +96,7 @@ final class ReedSolomonEncoder{
$modCoefficients = new GenericGFPoly($dataBytes, $rsPolyDegree)
->mod($rsPoly)
->getCoefficients()
;
->coefficients;
$ecBytes = array_fill(0, $rsPolyDegree, 0);
$count = (count($modCoefficients) - $rsPolyDegree);