[get-alternates] Minor simplify

This commit is contained in:
Behdad Esfahbod 2022-08-31 08:05:14 -06:00
parent 41aa02ae72
commit c96bfca380
1 changed files with 1 additions and 6 deletions

View File

@ -2322,11 +2322,6 @@ struct hb_get_glyph_alternates_dispatch_t :
static return_t default_return_value () { return 0; } static return_t default_return_value () { return 0; }
bool stop_sublookup_iteration (return_t r) const { return r; } bool stop_sublookup_iteration (return_t r) const { return r; }
hb_face_t *face;
hb_get_glyph_alternates_dispatch_t (hb_face_t *face) :
face (face) {}
private: private:
template <typename T, typename ...Ts> auto template <typename T, typename ...Ts> auto
_dispatch (const T &obj, hb_priority<1>, Ts&&... ds) HB_AUTO_RETURN _dispatch (const T &obj, hb_priority<1>, Ts&&... ds) HB_AUTO_RETURN
@ -2365,7 +2360,7 @@ hb_ot_layout_lookup_get_glyph_alternates (hb_face_t *face,
unsigned *alternate_count /* IN/OUT. May be NULL. */, unsigned *alternate_count /* IN/OUT. May be NULL. */,
hb_codepoint_t *alternate_glyphs /* OUT. May be NULL. */) hb_codepoint_t *alternate_glyphs /* OUT. May be NULL. */)
{ {
hb_get_glyph_alternates_dispatch_t c (face); hb_get_glyph_alternates_dispatch_t c;
const OT::SubstLookup &lookup = face->table.GSUB->table->get_lookup (lookup_index); const OT::SubstLookup &lookup = face->table.GSUB->table->get_lookup (lookup_index);
auto ret = lookup.dispatch (&c, glyph, start_offset, alternate_count, alternate_glyphs); auto ret = lookup.dispatch (&c, glyph, start_offset, alternate_count, alternate_glyphs);
if (!ret && alternate_count) *alternate_count = 0; if (!ret && alternate_count) *alternate_count = 0;