From 54db2b2ed62d29984b1974ad5f64f11d1bf6a50f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 26 Feb 2025 12:48:55 -0700 Subject: [PATCH] [SimpleGlyph] Remove a conditional from hot path 5% speedup in Roboto-Regular draw benchmark --- src/OT/glyf/SimpleGlyph.hh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/OT/glyf/SimpleGlyph.hh b/src/OT/glyf/SimpleGlyph.hh index 0a7cc6977..622faeb8e 100644 --- a/src/OT/glyf/SimpleGlyph.hh +++ b/src/OT/glyf/SimpleGlyph.hh @@ -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 {