From c72d3104ed0fe1fa91eb1ff02b0761578161edb0 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 27 Jun 2022 13:31:05 -0600 Subject: [PATCH] [map] Return const reference in operator[] --- src/hb-map.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-map.hh b/src/hb-map.hh index dbe41e1eb..ad52e69fe 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -211,7 +211,7 @@ struct hb_hashmap_t void del (K key) { set_with_hash (key, hb_hash (key), item_t::default_value (), true); } /* Has interface. */ - typedef V value_t; + typedef const V& value_t; value_t operator [] (K k) const { return get (k); } bool has (K key, const V **vp = nullptr) const {