(
edit: number,
excludeIdx: number,
newChild: Node<K, V> | undefined
)
| 745 | } |
| 746 | |
| 747 | private pack( |
| 748 | edit: number, |
| 749 | excludeIdx: number, |
| 750 | newChild: Node<K, V> | undefined |
| 751 | ): IndexedNode<K, V> { |
| 752 | const children: Array<Node<K, V>> = [] |
| 753 | let bitmap = 0 |
| 754 | let bit = 1 |
| 755 | |
| 756 | for (let i = 0; i < this.children.length; i++) { |
| 757 | const child = i === excludeIdx ? newChild : this.children[i] |
| 758 | if (child) { |
| 759 | children.push(child) |
| 760 | bitmap |= bit |
| 761 | } |
| 762 | bit <<= 1 |
| 763 | } |
| 764 | |
| 765 | return new IndexedNode(edit, bitmap, children) |
| 766 | } |
| 767 | |
| 768 | iterator(): Iterator<[K, V]> { |
| 769 | let childIndex = 0 |
no test coverage detected