[varc] Micro-optimize

This commit is contained in:
Behdad Esfahbod committed 2024-04-16 17:10:46 -06:00
1 parent d07d70aef1
commit 4e0845ab7b
2 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -191,7 +191,7 @@ VarComponent::get_path_at (hb_font_t *font,
{
unsigned axisIndicesIndex;
READ_UINT32VAR (axisIndicesIndex);
axisIndices = (&VARC+VARC.axisIndicesList)[axisIndicesIndex];
axisIndices = std::move((&VARC+VARC.axisIndicesList)[axisIndicesIndex]);
axisValuesInt.resize (axisIndices.length);
const HBUINT8 *p = (const HBUINT8 *) record.arrayZ;
TupleValues::decompile (p, axisValuesInt, (const HBUINT8 *) end);
+4 -4
View File
@@ -3139,21 +3139,21 @@ struct MultiVarData
return;
hb_vector_t<int> values_vector = deltaSets[inner];
hb_array_t<int> values = values_vector;
int *values = values_vector.arrayZ;
unsigned regionCount = regionIndices.len;
unsigned tupleLength = values.length / regionCount;
unsigned tupleLength = values_vector.length / regionCount;
unsigned count = hb_min (tupleLength, out.length);
for (unsigned regionIndex = 0; regionIndex < regionCount; regionIndex++)
{
float scalar = regions.evaluate (regionIndices[regionIndex],
float scalar = regions.evaluate (regionIndices.arrayZ[regionIndex],
coords, coord_count,
cache);
if (scalar)
{
for (unsigned i = 0; i < count; i++)
{
out[i] += values.arrayZ[i] * scalar;
out[i] += values[i] * scalar;
}
}
values += tupleLength;