move applicable copy_from_slice to copy_within

This commit is contained in:
Henry Schimke
2022-12-30 09:00:53 -06:00
parent 4f7478245a
commit a345a27b78
6 changed files with 13 additions and 13 deletions

View File

@@ -405,8 +405,8 @@ impl Code128Reader {
return Ok([patternStart, i, bestMatch as usize]);
}
patternStart += (counters[0] + counters[1]) as usize;
let slc = &counters[2..(counterPosition - 1 + 2)].to_vec();
counters[0..(counterPosition - 1)].copy_from_slice(slc);
counters.copy_within(2..(counterPosition - 1 + 2), 0);
// System.arraycopy(counters, 2, counters, 0, counterPosition - 1);
counters[counterPosition - 1] = 0;
counters[counterPosition] = 0;