mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-22 15:31:05 +01:00
[VarRegionAxis] Micro-optimize
peak==0 is common.
This commit is contained in:
1 parent
f91929d6da
commit
f6803b06bf
1 file changed
+5
-4
@@ -2272,7 +2272,11 @@ struct VarRegionAxis
|
||||
{
|
||||
float evaluate (int coord) const
|
||||
{
|
||||
int start = startCoord.to_int (), peak = peakCoord.to_int (), end = endCoord.to_int ();
|
||||
int peak = peakCoord.to_int ();
|
||||
if (peak == 0 || coord == peak)
|
||||
return 1.f;
|
||||
|
||||
int start = startCoord.to_int (), end = endCoord.to_int ();
|
||||
|
||||
/* TODO Move these to sanitize(). */
|
||||
if (unlikely (start > peak || peak > end))
|
||||
@@ -2280,9 +2284,6 @@ struct VarRegionAxis
|
||||
if (unlikely (start < 0 && end > 0 && peak != 0))
|
||||
return 1.f;
|
||||
|
||||
if (peak == 0 || coord == peak)
|
||||
return 1.f;
|
||||
|
||||
if (coord <= start || end <= coord)
|
||||
return 0.f;
|
||||
|
||||
|
||||
Reference in new issue
Block a user