[instancing] Micro-optimize a loop

pull/4476/head
Behdad Esfahbod 1 year ago
parent 29d49eced8
commit 59cfb4c570
  1. 21
      src/hb-ot-var-common.hh

@ -516,14 +516,19 @@ struct tuple_delta_t
return *this;
unsigned num = indices.length;
for (unsigned i = 0; i < num; i++)
{
if (!indices.arrayZ[i]) continue;
deltas_x[i] *= scalar;
if (deltas_y)
deltas_y[i] *= scalar;
}
if (deltas_y)
for (unsigned i = 0; i < num; i++)
{
if (!indices.arrayZ[i]) continue;
deltas_x[i] *= scalar;
deltas_y[i] *= scalar;
}
else
for (unsigned i = 0; i < num; i++)
{
if (!indices.arrayZ[i]) continue;
deltas_x[i] *= scalar;
}
return *this;
}

Loading…
Cancel
Save