From bbbea3dbd86ece2ba0f6a0f7f70ea240fbc5a40f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 11 Feb 2021 12:23:33 -0700 Subject: [PATCH] [minor] Rewrite set operation in OS/2 subsetting This patch could be nicer: https://github.com/harfbuzz/harfbuzz/pull/2572/files Just tiny touchup now. --- src/hb-ot-os2-table.hh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/hb-ot-os2-table.hh b/src/hb-ot-os2-table.hh index 7d31b712c..8e98f87f4 100644 --- a/src/hb-ot-os2-table.hh +++ b/src/hb-ot-os2-table.hh @@ -177,15 +177,14 @@ struct OS2 if (!c->plan->glyphs_requested->is_empty ()) { hb_map_t unicode_glyphid_map; - + OT::cmap::accelerator_t cmap; cmap.init (c->plan->source); cmap.collect_mapping (&unicodes, &unicode_glyphid_map); cmap.fini (); - - if (c->plan->unicodes->is_empty ()) unicodes.clear (); - else hb_set_set (&unicodes, c->plan->unicodes); - + + hb_set_set (&unicodes, c->plan->unicodes); + + unicode_glyphid_map.iter () | hb_filter (c->plan->glyphs_requested, hb_second) | hb_map (hb_first)