[buffer] Implement output_glyph() in terms of replace_glyphs(0,1)
To my surprise, saves ~20kb in my build (non-size-optimized) build. The output_glyph() method is never used in the fast paths, so doesn't matter if is not fully optimized for the special case it is.
This commit is contained in:
parent
34a1204f10
commit
862f913489
|
@ -251,15 +251,8 @@ struct hb_buffer_t
|
||||||
}
|
}
|
||||||
/* Makes a copy of the glyph at idx to output and replace glyph_index */
|
/* Makes a copy of the glyph at idx to output and replace glyph_index */
|
||||||
HB_NODISCARD bool output_glyph (hb_codepoint_t glyph_index)
|
HB_NODISCARD bool output_glyph (hb_codepoint_t glyph_index)
|
||||||
{
|
{ return replace_glyphs (0, 1, &glyph_index); }
|
||||||
if (unlikely (!make_room_for (0, 1))) return false;
|
|
||||||
|
|
||||||
out_info[out_len] = idx < len ? cur() : prev();
|
|
||||||
out_info[out_len].codepoint = glyph_index;
|
|
||||||
|
|
||||||
out_len++;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
HB_NODISCARD bool output_info (const hb_glyph_info_t &glyph_info)
|
HB_NODISCARD bool output_info (const hb_glyph_info_t &glyph_info)
|
||||||
{
|
{
|
||||||
if (unlikely (!make_room_for (0, 1))) return false;
|
if (unlikely (!make_room_for (0, 1))) return false;
|
||||||
|
|
Loading…
Reference in New Issue