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

Function collisionKeys

perf/Map.js:143–154  ·  view source on GitHub ↗
(rounds)

Source from the content-addressed store, hash-verified

141 // with a plain linear scan it is O(n²) to build or read them all.
142 describe('hash collisions', () => {
143 function collisionKeys(rounds) {
144 let keys = [''];
145 for (let i = 0; i < rounds; i++) {
146 const next = [];
147 for (let j = 0; j < keys.length; j++) {
148 next.push(keys[j] + 'Aa');
149 next.push(keys[j] + 'BB');
150 }
151 keys = next;
152 }
153 return keys;
154 }
155
156 [8, 10, 12].forEach((rounds) => {
157 const keys = collisionKeys(rounds);

Callers 1

Map.jsFile · 0.70

Calls 1

pushMethod · 0.65

Tested by

no test coverage detected