From b7a8d23bc8594c84c72d54dbbffa1c1acbb92c67 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 8 May 2023 14:32:24 -0600 Subject: [PATCH] [map] Micro-optimize for hb_map_t --- src/hb-map.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hb-map.hh b/src/hb-map.hh index 041b8829a..c685a9a3e 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -401,7 +401,8 @@ struct hb_hashmap_t unsigned int tombstone = (unsigned) -1; while (items[i].is_used ()) { - if (items[i].hash == hash && items[i] == key) + if ((hb_is_same (K, hb_codepoint_t) || items[i].hash == hash) && + items[i] == key) return items[i]; if (tombstone == (unsigned) -1 && items[i].is_tombstone ()) tombstone = i;