Replace buffer.slice() with buffer.subarray()

This commit is contained in:
Fedor Indutny
2025-06-09 14:37:30 -07:00
committed by GitHub
parent 4a6e2d297b
commit b0634f9a9d
19 changed files with 54 additions and 45 deletions

View File

@@ -143,7 +143,7 @@ export class ParseContactsTransform extends Transform {
const spaceLeftAfterRead = reader.len - (reader.pos + attachmentSize);
if (spaceLeftAfterRead >= 0) {
// We've read enough data to read the entire attachment
const avatarData = reader.buf.slice(
const avatarData = reader.buf.subarray(
reader.pos,
reader.pos + attachmentSize
);