[SimpleGlyph] Remove a conditional from hot path

5% speedup in Roboto-Regular draw benchmark
This commit is contained in:
Behdad Esfahbod 2025-02-26 12:48:55 -07:00
parent bb4d37b052
commit 54db2b2ed6

View file

@ -160,10 +160,7 @@ struct SimpleGlyph
if (flag & short_flag)
{
if (unlikely (p + 1 > end)) return false;
if (flag & same_flag)
v += *p++;
else
v -= *p++;
v += (bool(flag & same_flag) * 2 - 1) * *p++;
}
else
{