| 796 | } |
| 797 | |
| 798 | function packNodes(ownerID, nodes, count, excluding) { |
| 799 | let bitmap = 0; |
| 800 | let packedII = 0; |
| 801 | const packedNodes = new Array(count); |
| 802 | for (let ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) { |
| 803 | const node = nodes[ii]; |
| 804 | if (node !== undefined && ii !== excluding) { |
| 805 | bitmap |= bit; |
| 806 | packedNodes[packedII++] = node; |
| 807 | } |
| 808 | } |
| 809 | return new BitmapIndexedNode(ownerID, bitmap, packedNodes); |
| 810 | } |
| 811 | |
| 812 | function expandNodes(ownerID, nodes, bitmap, including, node) { |
| 813 | let count = 0; |