From 9897749113f76dc26a83bfae8de62e55d384fcad Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 27 Aug 2009 01:32:17 -0400 Subject: [PATCH] [HB] Simplify counting --- src/hb-ot-layout.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index 88823271b..c8d2d2c76 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -456,12 +456,13 @@ hb_ot_layout_language_get_feature_tags (hb_face_t *face, const LangSys &l = g.get_script (script_index).get_lang_sys (language_index); ASSERT_STATIC (sizeof (unsigned int) == sizeof (hb_tag_t)); - unsigned int count = feature_count ? *feature_count : 0; hb_bool_t ret = l.get_feature_indexes (feature_count, (unsigned int *) feature_tags); - count = feature_count ? MIN (count, *feature_count) : 0; - for (unsigned int i = 0; i < count; i++) - feature_tags[i] = g.get_feature_tag ((unsigned int) feature_tags[i]); + if (feature_tags) { + unsigned int count = *feature_count; + for (unsigned int i = 0; i < count; i++) + feature_tags[i] = g.get_feature_tag ((unsigned int) feature_tags[i]); + } return ret; }