summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2009-08-27 01:32:17 -0400
committerBehdad Esfahbod <behdad@behdad.org>2009-08-27 01:32:17 -0400
commitd82431ec05b92cef903d02d47d8069a9427e96b9 (patch)
tree89c7beae2132c793de21b3b2023619b5ee81adc0
parent98428c0680625be6737d89bca6104ff95cd7037b (diff)
downloadpango-d82431ec05b92cef903d02d47d8069a9427e96b9.tar.gz
[HB] Simplify counting
-rw-r--r--pango/opentype/hb-ot-layout.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/pango/opentype/hb-ot-layout.cc b/pango/opentype/hb-ot-layout.cc
index 88823271..c8d2d2c7 100644
--- a/pango/opentype/hb-ot-layout.cc
+++ b/pango/opentype/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;
}