MCPcopy Index your code
hub / github.com/immutable-js/immutable-js / packNodes

Function packNodes

src/Map.js:798–810  ·  view source on GitHub ↗
(ownerID, nodes, count, excluding)

Source from the content-addressed store, hash-verified

796}
797
798function 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
812function expandNodes(ownerID, nodes, bitmap, including, node) {
813 let count = 0;

Callers 1

updateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected