diff options
| author | Tyge Løvset <[email protected]> | 2020-03-10 22:46:20 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-03-10 22:46:20 +0100 |
| commit | 0311f213090836c068430523e1a1304dd7dabc3a (patch) | |
| tree | d3c766fea85923b781d1d6a12390c73b08fd9371 | |
| parent | 7943f6773864dfe1d63e4188a23a41f3f23d2b4f (diff) | |
| download | STC-modified-0311f213090836c068430523e1a1304dd7dabc3a.tar.gz STC-modified-0311f213090836c068430523e1a1304dd7dabc3a.zip | |
Add files via upload
Minor
| -rw-r--r-- | cmap.h | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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); \
} \
\
|
