1
0

some BitArray refactor

This commit is contained in:
2024-05-23 13:51:38 +02:00
parent 654151e06e
commit 6c7eac8217
2 changed files with 2 additions and 3 deletions

View File

@@ -199,7 +199,7 @@ export class BitArrayImpl implements BitArray {
return other instanceof BitArrayImpl ? return other instanceof BitArrayImpl ?
arrayLike(this.#bits).zip(arrayLike(other.#bits)).all(([a, b]) => (a & b) === b) : 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) { public intersects(other: BitArray) {

View File

@@ -2,8 +2,7 @@ import { asArray } from "../utils.js";
import { EmptyBitArray, BitArrayImpl } from "./impl.js"; import { EmptyBitArray, BitArrayImpl } from "./impl.js";
import { BitArray } from "./types.js"; import { BitArray } from "./types.js";
const emptyBitArray = new EmptyBitArray(); export const EMPTY = new EmptyBitArray();
export const EMPTY = emptyBitArray;
export function create(length: number): BitArray { export function create(length: number): BitArray {
if (length < 0) { if (length < 0) {