refactor(binary): reuse the 64-bit scalar reader for signed values (#16770)

This commit is contained in:
Vincent Koc authored and GitHub committed 2026-12-05 00:02:05 +08:00
1 parent 25def6f31f
commit 2fc54591f8
1 file changed
+1 -5
+1 -5
View File
@@ -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 {