Skip to content

Commit 4a4c14f

Browse files
committed
revert variable names
1 parent 469498a commit 4a4c14f

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lib/codec/plain.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,18 +152,20 @@ function decodeValues_INT96(cursor: Cursor, count: number, opts?: Options) {
152152
const treatAsTimestamp = opts?.treatInt96AsTimestamp === true;
153153

154154
for (let i = 0; i < count; ++i) {
155-
const nanosSinceMidnight = INT53.readInt64LE(cursor.buffer, cursor.offset);
156-
const julianDay = cursor.buffer.readUInt32LE(cursor.offset + 8);
155+
// when treatAsTimestamp is true, low is nanoseconds since midnight
156+
const low = INT53.readInt64LE(cursor.buffer, cursor.offset);
157+
// when treatAsTimestamp is true, high is Julian day
158+
const high = cursor.buffer.readUInt32LE(cursor.offset + 8);
157159

158160
if (treatAsTimestamp) {
159161
// Convert Julian day and nanoseconds to a timestamp
160-
values.push(convertInt96ToTimestamp(julianDay, nanosSinceMidnight));
162+
values.push(convertInt96ToTimestamp(high, low));
161163
} else {
162164
// For non-timestamp INT96 values, maintain existing behavior
163-
if (julianDay === 0xffffffff) {
164-
values.push(~-nanosSinceMidnight + 1); // negative value
165+
if (high === 0xffffffff) {
166+
values.push(~-low + 1); // negative value
165167
} else {
166-
values.push(nanosSinceMidnight); // positive value
168+
values.push(low); // positive value
167169
}
168170
}
169171

0 commit comments

Comments
 (0)