[HB] Simplify counting

This commit is contained in:
Behdad Esfahbod 2009-08-27 01:32:17 -04:00
parent 81a5c4df94
commit 9897749113
1 changed files with 5 additions and 4 deletions

View 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;
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;
}