dont offset based on len parity (#18)

This commit is contained in:
Max
2022-10-31 01:01:49 +01:00
committed by GitHub
parent 4e416badd0
commit 746d31d9f2
+1 -1
View File
@@ -245,7 +245,7 @@ impl<R> FileReader<R> {
/// the first element and all the 0's, turning it into `[a, b, c, ...]`.
fn decode_utf16(&mut self) {
// remove the 0's
let limit = self.buf.len() / 2 + 1 + (self.buf.len() % 2);
let limit = self.buf.len() / 2 + 1;
for i in 2..limit {
self.buf.swap(i, i * 2 - 1);