From 41d6e95b0d47c874b73b314cd147e6ea8ec5ddfb Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Mon, 2 Sep 2019 01:41:48 +0430 Subject: [PATCH] [subset] Use internal API of hb_set_t --- src/hb-subset.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/hb-subset.cc b/src/hb-subset.cc index 7b9e483c3..ec2f8892f 100644 --- a/src/hb-subset.cc +++ b/src/hb-subset.cc @@ -285,24 +285,23 @@ hb_subset (hb_face_t *source, hb_tag_t table_tags[32]; unsigned int offset = 0, count; bool success = true; - hb_set_t *tags_set = hb_set_create (); + hb_set_t tags_set; do { count = ARRAY_LENGTH (table_tags); hb_face_get_table_tags (source, offset, &count, table_tags); for (unsigned int i = 0; i < count; i++) { hb_tag_t tag = table_tags[i]; - if (_should_drop_table (plan, tag) && !hb_set_has (tags_set, tag)) + if (_should_drop_table (plan, tag) && !tags_set.has (tag)) { DEBUG_MSG(SUBSET, nullptr, "drop %c%c%c%c", HB_UNTAG (tag)); continue; } - hb_set_add (tags_set, tag); + tags_set.add (tag); success = success && _subset_table (plan, tag); } offset += count; } while (success && count == ARRAY_LENGTH (table_tags)); - hb_set_destroy (tags_set); hb_face_t *result = success ? hb_face_reference (plan->dest) : hb_face_get_empty (); hb_subset_plan_destroy (plan);