[buffer] Implement replace_glyph() in terms of replace_glyphs(1,1)

I get exact same binary size with this, suggesting that compiler is
optimizing these as needed.
This commit is contained in:
Behdad Esfahbod 2021-03-15 14:52:19 -06:00
parent 862f913489
commit f73982a699

View File

@ -237,18 +237,8 @@ struct hb_buffer_t
}
HB_NODISCARD bool replace_glyph (hb_codepoint_t glyph_index)
{
if (unlikely (out_info != info || out_len != idx))
{
if (unlikely (!make_room_for (1, 1))) return false;
out_info[out_len] = info[idx];
}
out_info[out_len].codepoint = glyph_index;
{ return replace_glyphs (1, 1, &glyph_index); }
idx++;
out_len++;
return true;
}
/* Makes a copy of the glyph at idx to output and replace glyph_index */
HB_NODISCARD bool output_glyph (hb_codepoint_t glyph_index)
{ return replace_glyphs (0, 1, &glyph_index); }