[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:
Behdad Esfahbod committed 2025-11-23 20:59:48 -07:00
1 parent dd36595893
commit c5a5334aea
1 file changed
+2 -2
+2 -2
View File
@@ -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)
{