[subset/loca] Micro-optimize

pull/4264/head
Behdad Esfahbod 1 year ago
parent 13a4c7b3d3
commit c7493efeaf
  1. 9
      src/OT/glyf/glyf-helpers.hh

@ -24,13 +24,15 @@ _write_loca (IteratorIn&& it,
unsigned num_glyphs = num_offsets - 1;
unsigned right_shift = short_offsets ? 1 : 0;
unsigned offset = 0;
*dest++ = 0;
TypeOut value;
value = 0;
*dest++ = value;
for (hb_codepoint_t i = 0, j = 0; i < num_glyphs; i++)
{
if (i != new_to_old_gid_list[j].first)
{
DEBUG_MSG (SUBSET, nullptr, "loca entry empty offset %u", offset);
*dest++ = offset >> right_shift;
*dest++ = value;
continue;
}
@ -38,7 +40,8 @@ _write_loca (IteratorIn&& it,
unsigned padded_size = *it++;
offset += padded_size;
DEBUG_MSG (SUBSET, nullptr, "loca entry offset %u padded-size %u", offset, padded_size);
*dest++ = offset >> right_shift;
value = offset >> right_shift;
*dest++ = value;
}
}

Loading…
Cancel
Save