[subset/cff1] Speed up plan_subset_charset

pull/4301/head
Behdad Esfahbod 2 years ago
parent 7305ec47b1
commit b4b80bcaea
  1. 8
      src/hb-subset-cff1.cc

@ -556,7 +556,13 @@ struct cff1_subset_plan
if (sid != last_sid + 1) if (sid != last_sid + 1)
{ {
code_pair_t pair { sid, glyph }; code_pair_t pair { sid, glyph };
subset_charset_ranges.push (pair); // This is stupid to do manually but it does show speedup.
// We should find up where the slowdown comes from in push()
// and fix it.
if ((int) subset_charset_ranges.length < subset_charset_ranges.allocated)
subset_charset_ranges.arrayZ[subset_charset_ranges.length++] = pair;
else
subset_charset_ranges.push (pair);
} }
last_sid = sid; last_sid = sid;
} }

Loading…
Cancel
Save