[ot-shape] Rewrite loop without foreach_grapheme()
We were not using the graphemes, and that's costlier than just for().
This commit is contained in:
parent
eee7b459ee
commit
0969614865
|
@ -588,9 +588,10 @@ hb_ensure_native_direction (hb_buffer_t *buffer)
|
||||||
{
|
{
|
||||||
bool found_number = false, found_letter = false;
|
bool found_number = false, found_letter = false;
|
||||||
const auto* info = buffer->info;
|
const auto* info = buffer->info;
|
||||||
foreach_grapheme (buffer, start, end)
|
const auto count = buffer->len;
|
||||||
|
for (unsigned i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
auto gc = _hb_glyph_info_get_general_category (&info[start]);
|
auto gc = _hb_glyph_info_get_general_category (&info[i]);
|
||||||
if (gc == HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER)
|
if (gc == HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER)
|
||||||
found_number = true;
|
found_number = true;
|
||||||
else if (HB_UNICODE_GENERAL_CATEGORY_IS_LETTER (gc))
|
else if (HB_UNICODE_GENERAL_CATEGORY_IS_LETTER (gc))
|
||||||
|
|
Loading…
Reference in New Issue