From 2fc54591f85c3a90023fe2c78de2b7c4f032aed1 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sat, 5 Dec 2026 00:02:05 +0800 Subject: [PATCH] refactor(binary): reuse the 64-bit scalar reader for signed values (#16770) --- src/domain/binaryContainer.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/domain/binaryContainer.ts b/src/domain/binaryContainer.ts index 5ed02d40c12..cb3bd50a568 100644 --- a/src/domain/binaryContainer.ts +++ b/src/domain/binaryContainer.ts @@ -380,11 +380,7 @@ export const readInt64At = ( bytes: Uint8Array, offset: number, little: boolean, -): bigint => { - const lo = readUint32At(bytes, little ? offset : offset + 4, little); - const hi = readInt32At(bytes, little ? offset + 4 : offset, little); - return (BigInt(hi) << 32n) | BigInt(lo); -}; +): bigint => BigInt.asIntN(64, readUint64At(bytes, offset, little)); /** Reader that checks every structural range before decoding numeric fields. */ export class BinaryReader {