Skip to content

Commit

Permalink
dont offset based on len parity (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxOhn authored Oct 31, 2022
1 parent 4e416ba commit 746d31d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parse/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 746d31d

Please sign in to comment.