mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-21 06:51:01 +01:00
[TupleValues] Micro-optimize
The compiler was using a memset here, but I think it was also emitting one conditional (checking i <= stop to begin with). We know that condition is always true. This shows a measurable 1 or 2 percent speedup for me in a mega benchmark of Google Sans Flex.
This commit is contained in:
1 parent
dd36595893
commit
c5a5334aea
1 file changed
+2
-2
+2
-2
@@ -1739,8 +1739,8 @@ struct TupleValues
|
||||
|
||||
if ((control & VALUES_SIZE_MASK) == VALUES_ARE_ZEROS)
|
||||
{
|
||||
for (; i < stop; i++)
|
||||
values.arrayZ[i] = 0;
|
||||
hb_memset (&values.arrayZ[i], 0, (stop - i) * sizeof (T));
|
||||
i = stop;
|
||||
}
|
||||
else if ((control & VALUES_SIZE_MASK) == VALUES_ARE_WORDS)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user