Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed Feb 7, 2025
1 parent 45bc12b commit 6319ce9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/parse-chunked.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ function createChunkParser() {
if ((seqLength !== 4 && byte >> 3 === 0b11110) ||
(seqLength !== 3 && byte >> 4 === 0b1110) ||
(seqLength !== 2 && byte >> 5 === 0b110)) {
pendingByteSeq = chunk.slice(chunk.length - seqLength);
chunk = chunk.slice(0, -seqLength);
pendingByteSeq = chunk.slice(chunk.length - seqLength); // use slice to avoid tying chunk
chunk = chunk.subarray(0, -seqLength); // use subarray to avoid buffer copy
}

break;
Expand Down

0 comments on commit 6319ce9

Please sign in to comment.