[subset] Minor rewrite in CoverageFormat2::serialize()

This commit is contained in:
Behdad Esfahbod 2022-05-18 13:25:42 -06:00
parent e91863b717
commit 6f37c20798
1 changed files with 1 additions and 6 deletions

View File

@ -1506,12 +1506,6 @@ struct CoverageFormat2
TRACE_SERIALIZE (this); TRACE_SERIALIZE (this);
if (unlikely (!c->extend_min (this))) return_trace (false); if (unlikely (!c->extend_min (this))) return_trace (false);
if (unlikely (!glyphs))
{
rangeRecord.len = 0;
return_trace (true);
}
/* TODO(iter) Write more efficiently? */ /* TODO(iter) Write more efficiently? */
unsigned num_ranges = 0; unsigned num_ranges = 0;
@ -1524,6 +1518,7 @@ struct CoverageFormat2
} }
if (unlikely (!rangeRecord.serialize (c, num_ranges))) return_trace (false); if (unlikely (!rangeRecord.serialize (c, num_ranges))) return_trace (false);
if (!num_ranges) return_trace (true);
unsigned count = 0; unsigned count = 0;
unsigned range = (unsigned) -1; unsigned range = (unsigned) -1;