Use dagger in hb_ot_layout_feature_get_characters

The way it used to work was a bit nonidiomatic but the replacment
is idiomatic way of iterating used elsewhere.

The new code just doesn't check nullability of "characters", which isn't
what we do anywhere else.
This commit is contained in:
Ebrahim Byagowi 2020-06-19 23:33:07 +04:30
parent 675854b2ba
commit 9b3d4f457e
1 changed files with 4 additions and 6 deletions

View File

@ -1727,14 +1727,12 @@ hb_ot_layout_feature_get_characters (hb_face_t *face,
.get_feature_params ()
.get_character_variants_params(g.get_feature_tag (feature_index));
unsigned int len = 0;
if (char_count && characters && start_offset < cv_params.characters.len)
if (char_count)
{
len = hb_min (cv_params.characters.len - start_offset, *char_count);
for (unsigned int i = 0; i < len; ++i)
characters[i] = cv_params.characters[start_offset + i];
+ cv_params.characters.sub_array (start_offset, char_count)
| hb_sink (hb_array (characters, *char_count))
;
}
if (char_count) *char_count = len;
return cv_params.characters.len;
}
#endif