diff options
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bimap.hh')
-rw-r--r-- | Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bimap.hh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bimap.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bimap.hh index 29291506ab1..a773951abdf 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bimap.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bimap.hh @@ -28,6 +28,7 @@ #define HB_BIMAP_HH #include "hb.hh" +#include "hb-map.hh" /* Bi-directional map */ struct hb_bimap_t @@ -57,6 +58,8 @@ struct hb_bimap_t void set (hb_codepoint_t lhs, hb_codepoint_t rhs) { + if (unlikely (lhs == HB_MAP_VALUE_INVALID)) return; + if (unlikely (rhs == HB_MAP_VALUE_INVALID)) { del (lhs); return; } forw_map.set (lhs, rhs); back_map.set (rhs, lhs); } @@ -131,6 +134,7 @@ struct hb_inc_bimap_t : hb_bimap_t work.qsort (cmp_id); + clear (); for (hb_codepoint_t rhs = 0; rhs < count; rhs++) set (work[rhs], rhs); } |