summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2020-03-10 22:46:20 +0100
committerGitHub <[email protected]>2020-03-10 22:46:20 +0100
commit0311f213090836c068430523e1a1304dd7dabc3a (patch)
treed3c766fea85923b781d1d6a12390c73b08fd9371
parent7943f6773864dfe1d63e4188a23a41f3f23d2b4f (diff)
downloadSTC-modified-0311f213090836c068430523e1a1304dd7dabc3a.tar.gz
STC-modified-0311f213090836c068430523e1a1304dd7dabc3a.zip
Add files via upload
Minor
-rw-r--r--cmap.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/cmap.h b/cmap.h
index a9a86e59..e12f7e4e 100644
--- a/cmap.h
+++ b/cmap.h
@@ -121,10 +121,10 @@ static inline void cmap_##tag##_setMaxLoadFactor(CMap_##tag* self, float fac) {
static inline size_t cmap_##tag##_bucket(CMap_##tag cm, KeyRaw rawKey) { \
size_t cap = cvector_capacity(cm._vec); \
size_t idx = cmap_reduce(keyHasher(&rawKey, sizeof(Key)), cap); \
- size_t first = idx, erased_idx = cap, state = cm._vec.data[idx].state; \
+ size_t first = idx, erased_idx = cap; \
FIBONACCI_DECL; \
do { \
- switch (state) { \
+ switch (cm._vec.data[idx].state) { \
case CMapEntry_VACANT: \
return erased_idx != cap ? erased_idx : idx; \
case CMapEntry_INUSE: \
@@ -141,7 +141,6 @@ static inline size_t cmap_##tag##_bucket(CMap_##tag cm, KeyRaw rawKey) { \
} \
idx = first + FIBONACCI_NEXT; \
if (idx >= cap) idx %= cap; \
- state = cm._vec.data[ idx ].state; \
} while (1); \
} \
\