From c011af18b9e4eaba875673cb2a598ad403df28a5 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 20 Aug 2026 02:48:34 -0600 Subject: [PATCH] [subset] Use set iterators when formatting input Walk tag sets and sorted glyph-map keys through their native iterators instead of repeatedly calling the public scalar set API. Tests: meson test -C build (272/272) Assisted-by: OpenAI Codex --- src/hb-subset-input.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/hb-subset-input.cc b/src/hb-subset-input.cc index 117a45fec..c3906fdc1 100644 --- a/src/hb-subset-input.cc +++ b/src/hb-subset-input.cc @@ -806,9 +806,8 @@ _format_tag (hb_tag_t tag, hb_vector_t &out) static void _format_tag_set (const hb_set_t *set, hb_vector_t &out) { - hb_codepoint_t tag = HB_SET_VALUE_INVALID; bool first_tag = true; - while (hb_set_next (set, &tag)) + for (hb_codepoint_t tag : *set) { if (!first_tag) out.push (','); @@ -916,9 +915,8 @@ _format_glyph_map_arg (const hb_map_t &glyph_map, hb_set_t keys; hb_map_keys (&glyph_map, &keys); hb_vector_t pairs; - hb_codepoint_t key = HB_SET_VALUE_INVALID; bool first = true; - while (hb_set_next (&keys, &key)) + for (hb_codepoint_t key : keys) { if (!first) pairs.push (',');