mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-20 22:41:10 +01:00
[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 <codex@openai.com>
This commit is contained in:
1 parent
3c55d48206
commit
c011af18b9
1 file changed
+2
-4
@@ -806,9 +806,8 @@ _format_tag (hb_tag_t tag, hb_vector_t<char> &out)
|
||||
static void
|
||||
_format_tag_set (const hb_set_t *set, hb_vector_t<char> &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<char> 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 (',');
|
||||
|
||||
Reference in new issue
Block a user