[HarfBuzz] harfbuzz: Branch 'master' - 2 commits

Behdad Esfahbod behdad at kemper.freedesktop.org
Tue May 29 23:39:21 UTC 2018


 src/hb-map-private.hh |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit face7cf55d4895ffca314c8448c0a749a26cc182
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue May 29 16:39:03 2018 -0700

    [map] Return bool from set()

diff --git a/src/hb-map-private.hh b/src/hb-map-private.hh
index 6aaf4c41..56377394 100644
--- a/src/hb-map-private.hh
+++ b/src/hb-map-private.hh
@@ -118,10 +118,10 @@ struct hb_map_t
     return true;
   }
 
-  inline void set (hb_codepoint_t key, hb_codepoint_t value)
+  inline bool set (hb_codepoint_t key, hb_codepoint_t value)
   {
-    if (unlikely (in_error)) return;
-    if ((occupancy + occupancy / 2) > mask && !resize ()) return;
+    if (unlikely (in_error)) return false;
+    if ((occupancy + occupancy / 2) > mask && !resize ()) return false;
     unsigned int i = bucket_for (key);
     if (items[i].key != key)
     {
@@ -130,6 +130,7 @@ struct hb_map_t
       items[i].key = key;
     }
     items[i].value = value;
+    return true;
   }
   inline hb_codepoint_t get (hb_codepoint_t key) const
   {
commit e94be200bd7976a26ea2d6df5050d9dab4de0f08
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue May 29 16:37:44 2018 -0700

    [map] Implement operator[] for get()ting

diff --git a/src/hb-map-private.hh b/src/hb-map-private.hh
index 723dde4f..6aaf4c41 100644
--- a/src/hb-map-private.hh
+++ b/src/hb-map-private.hh
@@ -151,6 +151,9 @@ struct hb_map_t
     return get (key) != INVALID;
   }
 
+  inline hb_codepoint_t operator [] (unsigned int key) const
+  { return get (key); }
+
   static const hb_codepoint_t INVALID = HB_MAP_VALUE_INVALID;
 
   protected:


More information about the HarfBuzz mailing list