mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-25 08:51:07 +01:00
[instancer] Micro-optimize a couple of hot comparisons
This commit is contained in:
1 parent
c938e8ce88
commit
1a6c6d7865
1 file changed
+6
-9
@@ -1762,19 +1762,16 @@ struct item_variations_t
|
||||
|
||||
bool operator < (const combined_gain_idx_tuple_t& o)
|
||||
{
|
||||
if (gain != o.gain)
|
||||
return gain < o.gain;
|
||||
|
||||
if (idx_1 != o.idx_1)
|
||||
return idx_1 < o.idx_1;
|
||||
|
||||
return idx_2 < o.idx_2;
|
||||
return gain < o.gain ||
|
||||
(gain == o.gain && (idx_1 < o.idx_1 ||
|
||||
(idx_1 == o.idx_1 && idx_2 < o.idx_2)));
|
||||
}
|
||||
|
||||
bool operator <= (const combined_gain_idx_tuple_t& o)
|
||||
{
|
||||
if (*this < o) return true;
|
||||
return gain == o.gain && idx_1 == o.idx_1 && idx_2 == o.idx_2;
|
||||
return gain < o.gain ||
|
||||
(gain == o.gain && (idx_1 < o.idx_1 ||
|
||||
(idx_1 == o.idx_1 && idx_2 <= o.idx_2)));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user