Skip to content
Myr

Fix temp_key being stale on key re-insert

Before adoption: this commit came in with the history the project adopted, so no landing records it.

See issue #992 and pull request #993.

authored by Macoy Madson · committed by Macoy Madson · parent c9064e3 · Browse files · 1 file+2 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−0 removed

  • other:+2 added−0 removed

1 file+2 added−0 removed

modified:stb_ds.h+2 added
1376 unmodified lines
1377 for (i=pos & STBDS_BUCKET_MASK; i < STBDS_BUCKET_LENGTH; ++i) {1378 if (bucket->hash[i] == hash) {1379 if (stbds_is_key_equal(raw_a, elemsize, key, keysize, keyoffset, mode, bucket->index[i])) {1380 stbds_temp(a) = bucket->index[i];1381 if (mode >= STBDS_HM_STRING)1382 stbds_temp_key(a) = * (char **) ((char *) raw_a + elemsize*bucket->index[i] + keyoffset);1383 return STBDS_ARR_TO_HASH(a,elemsize);1384 }1385 } else if (bucket->hash[i] == 0) {1386 pos = (pos & ~STBDS_BUCKET_MASK) + i;
496 unmodified lines