remove even more needless string conversions

This commit is contained in:
Vukašin Stepanović
2023-02-15 11:25:01 +00:00
parent df8828331d
commit bfcdb397ad
3 changed files with 6 additions and 6 deletions

View File

@@ -103,7 +103,7 @@ pub fn decode(
// for (int i = 0; i < errorLocations.length; i++) {
let position = received.len() as isize - 1 - field.log(errorLocations[i])? as isize;
if position < 0 {
return Err(Exceptions::checksum(file!().to_string()));
return Err(Exceptions::checksum(file!()));
}
received[position as usize] =
field.subtract(received[position as usize], errorMagnitudes[i]);
@@ -140,7 +140,7 @@ fn runEuclideanAlgorithm(
// Divide rLastLast by rLast, with quotient in q and remainder in r
if rLast.isZero() {
// Oops, Euclidean algorithm already terminated?
return Err(Exceptions::checksum(file!().to_string()));
return Err(Exceptions::checksum(file!()));
}
r = rLastLast;
let mut q = ModulusPoly::getZero(field); //field.getZero();
@@ -162,7 +162,7 @@ fn runEuclideanAlgorithm(
let sigmaTildeAtZero = t.getCoefficient(0);
if sigmaTildeAtZero == 0 {
return Err(Exceptions::checksum(file!().to_string()));
return Err(Exceptions::checksum(file!()));
}
let inverse = field.inverse(sigmaTildeAtZero)?;
@@ -190,7 +190,7 @@ fn findErrorLocations(
i += 1;
}
if e != numErrors {
return Err(Exceptions::checksum(file!().to_string()));
return Err(Exceptions::checksum(file!()));
}
Ok(result)
}