|
340 | 340 | hashMapInsert(Thread* t, object map, object key, object value,
|
341 | 341 | uint32_t (*hash)(Thread*, object))
|
342 | 342 | {
|
343 |
| - // note that we reinitialize the array and index variables whenever |
344 |
| - // an allocation (and thus possibly a collection) occurs, in case |
345 |
| - // the array changes due to a table resize. |
| 343 | + // note that we reinitialize the array variable whenever an |
| 344 | + // allocation (and thus possibly a collection) occurs, in case the |
| 345 | + // array changes due to a table resize. |
346 | 346 |
|
347 | 347 | PROTECT(t, map);
|
348 | 348 |
|
@@ -378,12 +378,11 @@ hashMapInsert(Thread* t, object map, object key, object value,
|
378 | 378 | array = hashMapArray(t, map);
|
379 | 379 | }
|
380 | 380 |
|
381 |
| - unsigned index = h & (arrayLength(t, array) - 1); |
382 |
| - |
383 | 381 | object n = makeTriple(t, k, value, 0);
|
384 | 382 |
|
385 | 383 | array = hashMapArray(t, map);
|
386 |
| - index = h & (arrayLength(t, array) - 1); |
| 384 | + |
| 385 | + unsigned index = h & (arrayLength(t, array) - 1); |
387 | 386 |
|
388 | 387 | set(t, n, TripleThird, arrayBody(t, array, index));
|
389 | 388 | set(t, array, ArrayBody + (index * BytesPerWord), n);
|
|
0 commit comments