remove unnecessary number suffixes

This commit is contained in:
Vukašin Stepanović
2023-02-17 16:12:23 +00:00
parent 01e4f4a126
commit c77f0af6f6
21 changed files with 46 additions and 58 deletions

View File

@@ -91,7 +91,7 @@ impl OneDReader for CodaBarReader {
// Look for whitespace after pattern:
let trailingWhitespace = self.counters[nextStart - 1];
let mut lastPatternSize = 0;
for i in -8isize..-1 {
for i in -8..-1 {
lastPatternSize += self.counters[(nextStart as isize + i) as usize];
}
@@ -283,7 +283,7 @@ impl CodaBarReader {
.nth(i)
.ok_or(Exceptions::indexOutOfBounds)?
as usize];
for j in (0usize..=6).rev() {
for j in (0..=6).rev() {
// Even j = bars, while odd j = spaces. Categories 2 and 3 are for
// long stripes, while 0 and 1 are for short stripes.
let category = (j & 1) + ((pattern as usize) & 1) * 2;