[HB] Simplify counting
authorBehdad Esfahbod <behdad@behdad.org>
Thu, 27 Aug 2009 05:32:17 +0000 (01:32 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Mon, 2 Nov 2009 19:40:47 +0000 (14:40 -0500)
src/hb-ot-layout.cc

index 8882327..c8d2d2c 100644 (file)
@@ -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;
 }