Simplify code
This commit is contained in:
parent
f5ef8a7347
commit
418e9d07e2
|
@ -659,10 +659,7 @@ struct Ligature
|
||||||
|
|
||||||
void closure (hb_closure_context_t *c) const
|
void closure (hb_closure_context_t *c) const
|
||||||
{
|
{
|
||||||
unsigned int count = component.lenP1;
|
if (!intersects (c->glyphs)) return;
|
||||||
for (unsigned int i = 1; i < count; i++)
|
|
||||||
if (!c->glyphs->has (component[i]))
|
|
||||||
return;
|
|
||||||
c->output->add (ligGlyph);
|
c->output->add (ligGlyph);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1024,20 +1021,9 @@ struct ReverseChainSingleSubstFormat1
|
||||||
|
|
||||||
void closure (hb_closure_context_t *c) const
|
void closure (hb_closure_context_t *c) const
|
||||||
{
|
{
|
||||||
|
if (!intersects (c->glyphs)) return;
|
||||||
|
|
||||||
const OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
|
const OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
|
||||||
|
|
||||||
unsigned int count;
|
|
||||||
|
|
||||||
count = backtrack.len;
|
|
||||||
for (unsigned int i = 0; i < count; i++)
|
|
||||||
if (!(this+backtrack[i]).intersects (c->glyphs))
|
|
||||||
return;
|
|
||||||
|
|
||||||
count = lookahead.len;
|
|
||||||
for (unsigned int i = 0; i < count; i++)
|
|
||||||
if (!(this+lookahead[i]).intersects (c->glyphs))
|
|
||||||
return;
|
|
||||||
|
|
||||||
const ArrayOf<GlyphID> &substitute = StructAfter<ArrayOf<GlyphID> > (lookahead);
|
const ArrayOf<GlyphID> &substitute = StructAfter<ArrayOf<GlyphID> > (lookahead);
|
||||||
|
|
||||||
+ hb_zip (this+coverage, substitute)
|
+ hb_zip (this+coverage, substitute)
|
||||||
|
|
Loading…
Reference in New Issue