Skip to content

Commit

Permalink
fix: review comment - disable bitwise for file
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Aug 27, 2022
1 parent 9a37743 commit 97c2486
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/marshal/src/encodePassable.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-bitwise */
// @ts-check
import { getTag } from './helpers/passStyle-helpers.js';
import { makeTagged } from './makeTagged.js';
Expand Down Expand Up @@ -59,11 +60,8 @@ const encodeBinary64 = n => {
asNumber[0] = n;
let bits = asBits[0];
if (n < 0) {
// XXX Why is the no-bitwise lint rule even a thing??
// eslint-disable-next-line no-bitwise
bits ^= 0xffffffffffffffffn;
} else {
// eslint-disable-next-line no-bitwise
bits ^= 0x8000000000000000n;
}
return `f${zeroPad(bits.toString(16), 16)}`;
Expand All @@ -73,10 +71,8 @@ const decodeBinary64 = encoded => {
assert(encoded.startsWith('f'), X`Encoded number expected: ${encoded}`);
let bits = BigInt(`0x${encoded.substring(1)}`);
if (encoded[1] < '8') {
// eslint-disable-next-line no-bitwise
bits ^= 0xffffffffffffffffn;
} else {
// eslint-disable-next-line no-bitwise
bits ^= 0x8000000000000000n;
}
asBits[0] = bits;
Expand Down

0 comments on commit 97c2486

Please sign in to comment.