[constexpr] Use initializer instead of assignment

pull/2875/head
Behdad Esfahbod 4 years ago
parent cc16b26ef4
commit f4f35a4d5f
  1. 6
      src/hb-ot-layout-common.hh
  2. 7
      src/hb-ot-layout-gsubgpos.hh

@ -1821,8 +1821,7 @@ struct ClassDefFormat1
}
/* TODO Speed up, using set overlap first? */
/* TODO(iter) Rewrite as dagger. */
HBUINT16 k; /* TODO(constexpr) use constructor to initialize. */
k = klass;
HBUINT16 k {klass};
const HBUINT16 *arr = classValue.arrayZ;
for (unsigned int i = 0; i < count; i++)
if (arr[i] == k && glyphs->has (startGlyph + i))
@ -1995,8 +1994,7 @@ struct ClassDefFormat2
}
/* TODO Speed up, using set overlap first? */
/* TODO(iter) Rewrite as dagger. */
HBUINT16 k; /* TODO(constexpr) use constructor to initialize. */
k = klass;
HBUINT16 k {klass};
const RangeRecord *arr = rangeRecord.arrayZ;
for (unsigned int i = 0; i < count; i++)
if (arr[i].value == k && arr[i].intersects (glyphs))

@ -2323,12 +2323,7 @@ struct ChainRule
{
c->copy (len);
for (const auto g : it)
{
/* TODO(constexpr) Simplify. */
HBUINT16 gid;
gid = g;
c->copy (gid);
}
c->copy (HBUINT16 {g});
}
ChainRule* copy (hb_serialize_context_t *c,

Loading…
Cancel
Save