mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-14 17:13:40 +00:00
Revert "[subset/cff1] Micro-optimize"
This reverts commit 93020621f0651920ff92e19f543fbf2351c8311b. This slowed down the common path actually.
This commit is contained in:
parent
f102d57a52
commit
072c9c06e0
1 changed files with 6 additions and 4 deletions
|
@ -396,28 +396,30 @@ struct Charset1_2 {
|
|||
{
|
||||
if (unlikely (glyph >= num_glyphs)) return 0;
|
||||
unsigned i;
|
||||
hb_codepoint_t orig_glyph = glyph;
|
||||
hb_codepoint_t start_glyph;
|
||||
if (cache && likely (cache->glyph <= glyph))
|
||||
{
|
||||
i = cache->code;
|
||||
glyph -= cache->glyph;
|
||||
start_glyph = cache->glyph;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (unlikely (glyph == 0)) return 0;
|
||||
i = 0;
|
||||
glyph -= 1;
|
||||
start_glyph = 1;
|
||||
}
|
||||
glyph -= start_glyph;
|
||||
for (;; i++)
|
||||
{
|
||||
unsigned count = ranges[i].nLeft;
|
||||
if (glyph <= count)
|
||||
{
|
||||
if (cache)
|
||||
*cache = {i, orig_glyph - glyph};
|
||||
*cache = {i, start_glyph};
|
||||
return ranges[i].first + glyph;
|
||||
}
|
||||
count++;
|
||||
start_glyph += count;
|
||||
glyph -= count;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue