From 00cfc5c17d3b792a579356ca998e361bcb414260 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 20 Jul 2022 14:38:28 -0600 Subject: [PATCH] [map] Don't set out value in has() if not found --- src/hb-map.hh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/hb-map.hh b/src/hb-map.hh index df72821c1..6af018552 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -222,10 +222,7 @@ struct hb_hashmap_t bool has (K key, const V **vp = nullptr) const { if (unlikely (!items)) - { - if (vp) *vp = &item_t::default_value (); return false; - } unsigned int i = bucket_for (key); if (items[i].is_real () && items[i] == key) { @@ -233,10 +230,7 @@ struct hb_hashmap_t return true; } else - { - if (vp) *vp = &item_t::default_value (); return false; - } } /* Projection. */ V operator () (K k) const { return get (k); }