mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-06 22:15:04 +00:00
[TupleValues] Micro-optimize
This commit is contained in:
parent
474c6e43a6
commit
043980a60e
1 changed files with 4 additions and 3 deletions
|
@ -1914,6 +1914,7 @@ struct TupleValues
|
|||
void _add_to (hb_array_t<float> out, float scale = 1.0f)
|
||||
{
|
||||
unsigned n = out.length;
|
||||
float *arrayZ = out.arrayZ;
|
||||
|
||||
for (unsigned i = 0; i < n;)
|
||||
{
|
||||
|
@ -1926,21 +1927,21 @@ struct TupleValues
|
|||
{
|
||||
const auto *pp = (const HBINT8 *) p;
|
||||
for (unsigned j = 0; j < count; j++)
|
||||
out.arrayZ[i + j] += scaled ? *pp++ * scale : *pp++;
|
||||
*arrayZ++ += scaled ? *pp++ * scale : *pp++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
const auto *pp = (const HBINT16 *) p;
|
||||
for (unsigned j = 0; j < count; j++)
|
||||
out.arrayZ[i + j] += scaled ? *pp++ * scale : *pp++;
|
||||
*arrayZ++ += scaled ? *pp++ * scale : *pp++;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
const auto *pp = (const HBINT32 *) p;
|
||||
for (unsigned j = 0; j < count; j++)
|
||||
out.arrayZ[i + j] += scaled ? *pp++ * scale : *pp++;
|
||||
*arrayZ++ += scaled ? *pp++ * scale : *pp++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue