From 6c7eac8217ae2bdc187b4cd1e763888ede084c1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20BECHER?= Date: Thu, 23 May 2024 13:51:38 +0200 Subject: [PATCH] some BitArray refactor --- src/bitarray/impl.ts | 2 +- src/bitarray/index.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/bitarray/impl.ts b/src/bitarray/impl.ts index 4d3435c..82007c5 100644 --- a/src/bitarray/impl.ts +++ b/src/bitarray/impl.ts @@ -199,7 +199,7 @@ export class BitArrayImpl implements BitArray { return other instanceof BitArrayImpl ? arrayLike(this.#bits).zip(arrayLike(other.#bits)).all(([a, b]) => (a & b) === b) : - sequence(this).zip(sequence(other)).where(([, b]) => b).all(([a, b]) => a && b); + sequence(this).zip(sequence(other)).where(([, b]) => b).all(([a]) => a); } public intersects(other: BitArray) { diff --git a/src/bitarray/index.ts b/src/bitarray/index.ts index b2372f9..8fa2b94 100644 --- a/src/bitarray/index.ts +++ b/src/bitarray/index.ts @@ -2,8 +2,7 @@ import { asArray } from "../utils.js"; import { EmptyBitArray, BitArrayImpl } from "./impl.js"; import { BitArray } from "./types.js"; -const emptyBitArray = new EmptyBitArray(); -export const EMPTY = emptyBitArray; +export const EMPTY = new EmptyBitArray(); export function create(length: number): BitArray { if (length < 0) {