mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-27 21:02:35 +00:00
cleanup
This commit is contained in:
@@ -47,7 +47,7 @@ impl GenericGFPoly {
|
||||
* or if leading coefficient is 0 and this is not a
|
||||
* constant polynomial (that is, it is not the monomial "0")
|
||||
*/
|
||||
pub fn new(field: GenericGFRef, coefficients: &Vec<i32>) -> Result<Self, Exceptions> {
|
||||
pub fn new(field: GenericGFRef, coefficients: &[i32]) -> Result<Self, Exceptions> {
|
||||
if coefficients.is_empty() {
|
||||
return Err(Exceptions::IllegalArgumentException(Some(
|
||||
"coefficients.len()".to_owned(),
|
||||
|
||||
@@ -76,9 +76,8 @@ impl ReedSolomonDecoder {
|
||||
if noError {
|
||||
return Ok(0);
|
||||
}
|
||||
let syndrome = match GenericGFPoly::new(self.field, &syndromeCoefficients) {
|
||||
Ok(res) => res,
|
||||
Err(_fail) => return Err(Exceptions::ReedSolomonException(None)),
|
||||
let Ok(syndrome) = GenericGFPoly::new(self.field, &syndromeCoefficients) else {
|
||||
return Err(Exceptions::ReedSolomonException(None));
|
||||
};
|
||||
let sigmaOmega = self.runEuclideanAlgorithm(
|
||||
&GenericGF::buildMonomial(self.field, twoS as usize, 1),
|
||||
|
||||
@@ -38,7 +38,7 @@ impl ReedSolomonEncoder {
|
||||
pub fn new(field: GenericGFRef) -> Self {
|
||||
let n = field;
|
||||
Self {
|
||||
cachedGenerators: vec![GenericGFPoly::new(n, &vec![1]).unwrap()],
|
||||
cachedGenerators: vec![GenericGFPoly::new(n, &[1]).unwrap()],
|
||||
field: n,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user