summaryrefslogtreecommitdiffhomepage
path: root/benchmarks
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-04-26 21:14:52 +0200
committerTyge Løvset <[email protected]>2021-04-26 21:14:52 +0200
commitc214f87196b772ee33c633d6010f90bd7b60a0b6 (patch)
tree1de9775c286aee3cd0fc982ad26d8cfb124b4a85 /benchmarks
parent69c859a2fcb5053b6dbca8afe083df3843cec25b (diff)
downloadSTC-modified-c214f87196b772ee33c633d6010f90bd7b60a0b6.tar.gz
STC-modified-c214f87196b772ee33c633d6010f90bd7b60a0b6.zip
BUGFIX in csmap: Silly bug: assumed cmp function returned -1, 0, 1, but can be any number.
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/others/csmap_v1.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/benchmarks/others/csmap_v1.h b/benchmarks/others/csmap_v1.h
index 081886c7..5b1d6acb 100644
--- a/benchmarks/others/csmap_v1.h
+++ b/benchmarks/others/csmap_v1.h
@@ -386,7 +386,7 @@ int main(void) {
up[top++] = it; \
C##X##_rawkey_t r = keyToRaw(KEY_REF_##C(&it->value)); \
if ((c = keyCompareRaw(&r, rkey)) == 0) {res->ref = &it->value; return tn;} \
- it = it->link[(dir = (c == -1))]; \
+ it = it->link[(dir = (c < 0))]; \
} \
tn = c_new(C##X##_node_t); \
res->ref = &tn->value, res->inserted = true; \
@@ -417,7 +417,7 @@ int main(void) {
C##X##_rawkey_t raw = keyToRaw(KEY_REF_##C(&tn->value)); \
C##X##_node_t *tx; int c = keyCompareRaw(&raw, rkey); \
if (c != 0) \
- tn->link[c == -1] = C##X##_erase_r_(tn->link[c == -1], rkey, erased); \
+ tn->link[c < 0] = C##X##_erase_r_(tn->link[c < 0], rkey, erased); \
else { \
if (!*erased) {C##X##_value_del(&tn->value); *erased = 1;} \
if (tn->link[0]->level && tn->link[1]->level) { \