From 30579f5a37a7f0e044572e978660f050dc85559a Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 29 Jul 2021 11:19:13 -0600 Subject: [PATCH] [set] Document & use open-ended del_range() --- src/hb-ot-layout-common.hh | 2 +- src/hb-ot-layout-gsubgpos.hh | 2 +- src/hb-set.cc | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index 26cc2a4df..b3f9535c3 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -2792,7 +2792,7 @@ struct VariationStore hb_set_t region_indices; for (unsigned int i = 0; i < inner_maps.length; i++) (src+src->dataSets[i]).collect_region_refs (region_indices, inner_maps[i]); - region_indices.del_range ((src_regions).regionCount, region_indices.get_max ()); + region_indices.del_range ((src_regions).regionCount, hb_set_t::INVALID); /* TODO use constructor when our data-structures support that. */ hb_inc_bimap_t region_map; diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index c17bf92aa..f1c111a4a 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -183,7 +183,7 @@ struct hb_closure_context_t : void flush () { - hb_set_del_range (output, face->get_num_glyphs (), hb_set_get_max (output)); /* Remove invalid glyphs. */ + hb_set_del_range (output, face->get_num_glyphs (), HB_SET_VALUE_INVALID); /* Remove invalid glyphs. */ hb_set_union (glyphs, output); hb_set_clear (output); active_glyphs_stack.pop (); diff --git a/src/hb-set.cc b/src/hb-set.cc index 9efb76a4f..25f29c67b 100644 --- a/src/hb-set.cc +++ b/src/hb-set.cc @@ -301,6 +301,9 @@ hb_set_del (hb_set_t *set, * Removes all of the elements from @first to @last * (inclusive) from @set. * + * If @last is #HB_SET_VALUE_INVALID, then all values + * greater than or equal to @first are removed. + * * Since: 0.9.7 **/ void