From 82545c5e2ba2067f2eb117c7358ed6d5b50ca942 Mon Sep 17 00:00:00 2001 From: blueshade7 Date: Tue, 26 Nov 2019 10:24:32 -0800 Subject: [PATCH] more coding style fixes --- src/hb-ot-font.cc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc index bc5ee0f85..a1dc88603 100644 --- a/src/hb-ot-font.cc +++ b/src/hb-ot-font.cc @@ -183,22 +183,21 @@ hb_ot_get_glyph_extents (hb_font_t *font, void *user_data HB_UNUSED) { const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data; - bool ret = false; #if !defined(HB_NO_OT_FONT_BITMAP) && !defined(HB_NO_COLOR) - if (!ret) ret = ot_face->sbix->get_extents (font, glyph, extents); + if (ot_face->sbix->get_extents (font, glyph, extents)) return true; #endif - if (!ret) ret = ot_face->glyf->get_extents (font, glyph, extents); + if (ot_face->glyf->get_extents (font, glyph, extents)) return true; #ifndef HB_NO_OT_FONT_CFF - if (!ret) ret = ot_face->cff1->get_extents (font, glyph, extents); - if (!ret) ret = ot_face->cff2->get_extents (font, glyph, extents); + if (ot_face->cff1->get_extents (font, glyph, extents)) return true; + if (ot_face->cff2->get_extents (font, glyph, extents)) return true; #endif #if !defined(HB_NO_OT_FONT_BITMAP) && !defined(HB_NO_COLOR) - if (!ret) ret = ot_face->CBDT->get_extents (font, glyph, extents); + if (ot_face->CBDT->get_extents (font, glyph, extents)) return true; #endif // TODO Hook up side-bearings variations. - return ret; + return false; } #ifndef HB_NO_OT_FONT_GLYPH_NAMES @@ -224,11 +223,11 @@ hb_ot_get_glyph_from_name (hb_font_t *font HB_UNUSED, void *user_data HB_UNUSED) { const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data; - hb_bool_t ret = ot_face->post->get_glyph_from_name (name, len, glyph); + if (ot_face->post->get_glyph_from_name (name, len, glyph)) return true; #ifndef HB_NO_OT_FONT_CFF - if (!ret) ret = ot_face->cff1->get_glyph_from_name (name, len, glyph); + if (ot_face->cff1->get_glyph_from_name (name, len, glyph)) return true; #endif - return ret; + return false; } #endif