[gvar] Micro-optimize int types
This commit is contained in:
parent
4afcdf675b
commit
1e8a342ea2
|
@ -281,7 +281,7 @@ struct GlyphVariationData
|
||||||
|
|
||||||
if (unlikely (p + 1 > end)) return false;
|
if (unlikely (p + 1 > end)) return false;
|
||||||
|
|
||||||
uint16_t count = *p++;
|
unsigned count = *p++;
|
||||||
if (count & POINTS_ARE_WORDS)
|
if (count & POINTS_ARE_WORDS)
|
||||||
{
|
{
|
||||||
if (unlikely (p + 1 > end)) return false;
|
if (unlikely (p + 1 > end)) return false;
|
||||||
|
@ -290,13 +290,13 @@ struct GlyphVariationData
|
||||||
if (unlikely (!points.resize (count, false))) return false;
|
if (unlikely (!points.resize (count, false))) return false;
|
||||||
|
|
||||||
unsigned int n = 0;
|
unsigned int n = 0;
|
||||||
uint16_t i = 0;
|
unsigned i = 0;
|
||||||
while (i < count)
|
while (i < count)
|
||||||
{
|
{
|
||||||
if (unlikely (p + 1 > end)) return false;
|
if (unlikely (p + 1 > end)) return false;
|
||||||
uint16_t j;
|
unsigned j;
|
||||||
uint8_t control = *p++;
|
unsigned control = *p++;
|
||||||
uint16_t run_count = (control & POINT_RUN_COUNT_MASK) + 1;
|
unsigned run_count = (control & POINT_RUN_COUNT_MASK) + 1;
|
||||||
if (control & POINTS_ARE_WORDS)
|
if (control & POINTS_ARE_WORDS)
|
||||||
{
|
{
|
||||||
if (unlikely (p + run_count * HBUINT16::static_size > end)) return false;
|
if (unlikely (p + run_count * HBUINT16::static_size > end)) return false;
|
||||||
|
@ -332,14 +332,14 @@ struct GlyphVariationData
|
||||||
DELTA_RUN_COUNT_MASK = 0x3F
|
DELTA_RUN_COUNT_MASK = 0x3F
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned int i = 0;
|
unsigned i = 0;
|
||||||
unsigned int count = deltas.length;
|
unsigned count = deltas.length;
|
||||||
while (i < count)
|
while (i < count)
|
||||||
{
|
{
|
||||||
if (unlikely (p + 1 > end)) return false;
|
if (unlikely (p + 1 > end)) return false;
|
||||||
uint8_t control = *p++;
|
unsigned control = *p++;
|
||||||
unsigned int run_count = (control & DELTA_RUN_COUNT_MASK) + 1;
|
unsigned run_count = (control & DELTA_RUN_COUNT_MASK) + 1;
|
||||||
unsigned int j;
|
unsigned j;
|
||||||
if (control & DELTAS_ARE_ZERO)
|
if (control & DELTAS_ARE_ZERO)
|
||||||
for (j = 0; j < run_count && i < count; j++, i++)
|
for (j = 0; j < run_count && i < count; j++, i++)
|
||||||
deltas.arrayZ[i] = 0;
|
deltas.arrayZ[i] = 0;
|
||||||
|
|
Loading…
Reference in New Issue