MCPcopy
hub / github.com/immutable-js/immutable-js / popCount

Function popCount

src/Map.js:822–829  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

820}
821
822function popCount(x) {
823 x -= (x >> 1) & 0x55555555;
824 x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
825 x = (x + (x >> 4)) & 0x0f0f0f0f;
826 x += x >> 8;
827 x += x >> 16;
828 return x & 0x7f;
829}
830
831function setAt(array, idx, val, canEdit) {
832 const newArray = canEdit ? array : arrCopy(array);

Callers 2

getMethod · 0.85
updateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected