Skip to content

Commit e72c205

Browse files
committed
refactor: change implementation again to avoid bitwise operation
1 parent dd57472 commit e72c205

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ export function areUint8ArraysEqual(a: Uint8Array, b: Uint8Array): boolean {
544544
let diff = 0;
545545

546546
for (let i = 0; i < a.byteLength; i++) {
547-
diff |= viewA.getUint8(i) ^ viewB.getUint8(i);
547+
diff += viewA.getUint8(i) === viewB.getUint8(i) ? 0 : 1;
548548
}
549549

550550
return diff === 0;

0 commit comments

Comments
 (0)