From 2d4557fe04504d97db02e697482388a91fc9613e Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 25 Jun 2022 19:28:33 -0600 Subject: [PATCH] [glyf/SimpleGlyph] Use member pointer instead of lambda --- src/OT/glyf/SimpleGlyph.hh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/OT/glyf/SimpleGlyph.hh b/src/OT/glyf/SimpleGlyph.hh index c5800042e..2f1eb9e09 100644 --- a/src/OT/glyf/SimpleGlyph.hh +++ b/src/OT/glyf/SimpleGlyph.hh @@ -120,7 +120,7 @@ struct SimpleGlyph static bool read_points (const HBUINT8 *&p /* IN/OUT */, contour_point_vector_t &points_ /* IN/OUT */, const hb_bytes_t &bytes, - void (* setter) (contour_point_t &_, float v), + float contour_point_t::*m, const simple_glyph_flag_t short_flag, const simple_glyph_flag_t same_flag) { @@ -145,7 +145,7 @@ struct SimpleGlyph p += HBINT16::static_size; } } - setter (points_[i], v); + points_[i].*m = v; } return true; } @@ -184,9 +184,9 @@ struct SimpleGlyph } /* Read x & y coordinates */ - return read_points (p, points_, bytes, [] (contour_point_t &p, float v) { p.x = v; }, + return read_points (p, points_, bytes, &contour_point_t::x, FLAG_X_SHORT, FLAG_X_SAME) - && read_points (p, points_, bytes, [] (contour_point_t &p, float v) { p.y = v; }, + && read_points (p, points_, bytes, &contour_point_t::y, FLAG_Y_SHORT, FLAG_Y_SAME); } };