From 2dd0803c850521d104bb927de8fc54e2b9d64166 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 9 May 2023 20:35:09 -0600 Subject: [PATCH] [map] Downgrade from quadratic to linear probing --- src/hb-map.hh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/hb-map.hh b/src/hb-map.hh index f4ab35b4b..3e9288521 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -400,7 +400,6 @@ struct hb_hashmap_t { hash &= 0x3FFFFFFF; // We only store lower 30bit of hash unsigned int i = hash % prime; - unsigned int step = 0; unsigned int tombstone = (unsigned) -1; while (items[i].is_used ()) { @@ -409,7 +408,7 @@ struct hb_hashmap_t return items[i]; if (tombstone == (unsigned) -1 && items[i].is_tombstone ()) tombstone = i; - i = (i + ++step) & mask; + i = (i + 1) & mask; } return items[tombstone == (unsigned) -1 ? i : tombstone]; }