[map] Add hb_map_filter_invalid

Use it in one place.
This commit is contained in:
Behdad Esfahbod 2022-12-04 11:01:45 -07:00
parent 260df1fa32
commit 8d7e921117
2 changed files with 3 additions and 1 deletions

View File

@ -147,8 +147,8 @@ struct Coverage
TRACE_SUBSET (this);
auto it =
+ iter ()
| hb_filter (c->plan->glyph_map_gsub)
| hb_map_retains_sorting (c->plan->glyph_map_gsub)
| hb_filter (hb_map_filter_invalid)
;
// Cache the iterator result as it will be iterated multiple times

View File

@ -451,6 +451,8 @@ struct hb_map_t : hb_hashmap_t<hb_codepoint_t,
hb_map_t (const Iterable &o) : hashmap (o) {}
};
static inline bool hb_map_filter_invalid (hb_codepoint_t _) { return _ != HB_MAP_VALUE_INVALID; }
template <typename K, typename V>
static inline
hb_hashmap_t<K, V>* hb_hashmap_create ()