From 4a93576bca0f56e82a1d8ad67733df9c5ddb8dcd Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 28 May 2023 13:22:35 -0600 Subject: [PATCH] Revert "[map] Speedup for int types" This reverts commit c1b75f5ff0460274229801816265a0efe5731b3a. I was seeing very long chains (140) and a 17% slowdown in BM_subset/subset_codepoints/RobotoFlex-Variable.ttf/512 Bummer. --- src/hb-map.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hb-map.hh b/src/hb-map.hh index b70070a48..5debdaccd 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -212,7 +212,7 @@ struct hb_hashmap_t hash &= 0x3FFFFFFF; // We only store lower 30bit of hash unsigned int tombstone = (unsigned int) -1; - unsigned int i = std::is_integral::value ? hash & mask : hash % prime; + unsigned int i = hash % prime; unsigned length = 0; unsigned step = 0; while (items[i].is_used ()) @@ -295,7 +295,7 @@ struct hb_hashmap_t if (unlikely (!items)) return nullptr; hash &= 0x3FFFFFFF; // We only store lower 30bit of hash - unsigned int i = std::is_integral::value ? hash & mask : hash % prime; + unsigned int i = hash % prime; unsigned step = 0; while (items[i].is_used ()) {