| 1 | export default class BitSet { |
| 2 | declare bits: number[] |
| 3 | |
| 4 | constructor(arg?: BitSet) { |
| 5 | this.bits = arg instanceof BitSet ? arg.bits.slice() : [] |
| 6 | } |
| 7 | |
| 8 | add(n: number): void { |
| 9 | this.bits[n >> 5] |= 1 << (n & 31) |
| 10 | } |
| 11 | |
| 12 | has(n: number): boolean { |
| 13 | return !!(this.bits[n >> 5] & (1 << (n & 31))) |
| 14 | } |
| 15 | } |
nothing calls this directly
no outgoing calls
no test coverage detected