mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-28 05:12:34 +00:00
move applicable copy_from_slice to copy_within
This commit is contained in:
@@ -405,8 +405,8 @@ impl Code128Reader {
|
|||||||
return Ok([patternStart, i, bestMatch as usize]);
|
return Ok([patternStart, i, bestMatch as usize]);
|
||||||
}
|
}
|
||||||
patternStart += (counters[0] + counters[1]) 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);
|
// System.arraycopy(counters, 2, counters, 0, counterPosition - 1);
|
||||||
counters[counterPosition - 1] = 0;
|
counters[counterPosition - 1] = 0;
|
||||||
counters[counterPosition] = 0;
|
counters[counterPosition] = 0;
|
||||||
|
|||||||
@@ -171,8 +171,8 @@ impl Code93Reader {
|
|||||||
return Ok([patternStart, i]);
|
return Ok([patternStart, i]);
|
||||||
}
|
}
|
||||||
patternStart += (theCounters[0] + theCounters[1]) as usize;
|
patternStart += (theCounters[0] + theCounters[1]) as usize;
|
||||||
let slc = &theCounters[2..(counterPosition - 1 + 2)].to_vec();
|
|
||||||
theCounters[0..(counterPosition - 1)].copy_from_slice(slc);
|
theCounters.copy_within(2..(counterPosition - 1 + 2), 0);
|
||||||
// System.arraycopy(theCounters, 2, theCounters, 0, counterPosition - 1);
|
// System.arraycopy(theCounters, 2, theCounters, 0, counterPosition - 1);
|
||||||
theCounters[counterPosition - 1] = 0;
|
theCounters[counterPosition - 1] = 0;
|
||||||
theCounters[counterPosition] = 0;
|
theCounters[counterPosition] = 0;
|
||||||
|
|||||||
@@ -384,8 +384,8 @@ impl ITFReader {
|
|||||||
return Ok([patternStart, x]);
|
return Ok([patternStart, x]);
|
||||||
}
|
}
|
||||||
patternStart += (counters[0] + counters[1]) as usize;
|
patternStart += (counters[0] + counters[1]) as usize;
|
||||||
let slc = &counters[2..(counterPosition - 1 + 2)].to_vec();
|
|
||||||
counters[..(counterPosition - 1)].copy_from_slice(slc);
|
counters.copy_within(2..(counterPosition - 1 + 2), 0);
|
||||||
// System.arraycopy(counters, 2, counters, 0, counterPosition - 1);
|
// System.arraycopy(counters, 2, counters, 0, counterPosition - 1);
|
||||||
counters[counterPosition - 1] = 0;
|
counters[counterPosition - 1] = 0;
|
||||||
counters[counterPosition] = 0;
|
counters[counterPosition] = 0;
|
||||||
|
|||||||
@@ -803,8 +803,8 @@ impl RSSExpandedReader {
|
|||||||
|
|
||||||
// Make 'counters' hold 1-4
|
// Make 'counters' hold 1-4
|
||||||
let mut counters = self.decodeFinderCounters;
|
let mut counters = self.decodeFinderCounters;
|
||||||
let slc = counters[..counters.len() - 1].to_vec();
|
let counters_len = counters.len();
|
||||||
counters[1..].copy_from_slice(&slc);
|
counters.copy_within(..counters_len - 1, 1);
|
||||||
// System.arraycopy(counters, 0, counters, 1, counters.length - 1);
|
// System.arraycopy(counters, 0, counters, 1, counters.length - 1);
|
||||||
|
|
||||||
counters[0] = firstCounter as u32;
|
counters[0] = firstCounter as u32;
|
||||||
|
|||||||
@@ -464,10 +464,10 @@ impl RSS14Reader {
|
|||||||
}
|
}
|
||||||
firstElementStart += 1;
|
firstElementStart += 1;
|
||||||
let firstCounter = startEnd[0] - firstElementStart as usize;
|
let firstCounter = startEnd[0] - firstElementStart as usize;
|
||||||
let mut counters = &mut self.decodeFinderCounters;
|
let counters = &mut self.decodeFinderCounters;
|
||||||
let counter_len = counters.len();
|
let counter_len = counters.len();
|
||||||
let slc = counters[0..counter_len - 1].to_vec();
|
|
||||||
counters[1..counter_len].copy_from_slice(&slc);
|
counters.copy_within(..counter_len - 1, 1);
|
||||||
// Make 'counters' hold 1-4
|
// Make 'counters' hold 1-4
|
||||||
// let counters = self.getDecodeFinderCounters();
|
// let counters = self.getDecodeFinderCounters();
|
||||||
// System.arraycopy(counters, 0, counters, 1, counters.length - 1);
|
// System.arraycopy(counters, 0, counters, 1, counters.length - 1);
|
||||||
|
|||||||
@@ -442,8 +442,8 @@ pub trait UPCEANReader: OneDReader {
|
|||||||
return Ok([patternStart, x]);
|
return Ok([patternStart, x]);
|
||||||
}
|
}
|
||||||
patternStart += (counters[0] + counters[1]) as usize;
|
patternStart += (counters[0] + counters[1]) as usize;
|
||||||
let slc = &counters[2..(counterPosition - 1 + 2)].to_vec();
|
|
||||||
counters[..(counterPosition - 1)].copy_from_slice(slc);
|
counters.copy_within(2..(counterPosition - 1 + 2), 0);
|
||||||
// System.arraycopy(counters, 2, counters, 0, counterPosition - 1);
|
// System.arraycopy(counters, 2, counters, 0, counterPosition - 1);
|
||||||
counters[counterPosition - 1] = 0;
|
counters[counterPosition - 1] = 0;
|
||||||
counters[counterPosition] = 0;
|
counters[counterPosition] = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user