[serialize] Fix a TODO
This commit is contained in:
parent
d8a49b53e3
commit
99ed6e29d8
|
@ -1043,12 +1043,16 @@ struct Coverage
|
||||||
TRACE_SERIALIZE (this);
|
TRACE_SERIALIZE (this);
|
||||||
if (unlikely (!c->extend_min (*this))) return_trace (false);
|
if (unlikely (!c->extend_min (*this))) return_trace (false);
|
||||||
|
|
||||||
/* TODO(iter) Port to non-random-access iterator interface. */
|
unsigned count = 0;
|
||||||
unsigned int count = glyphs.len ();
|
unsigned num_ranges = 0;
|
||||||
unsigned int num_ranges = 1;
|
hb_codepoint_t last = (hb_codepoint_t) -2;
|
||||||
for (unsigned int i = 1; i < count; i++)
|
for (auto g: glyphs)
|
||||||
if (glyphs[i - 1] + 1 != glyphs[i])
|
{
|
||||||
num_ranges++;
|
if (last + 1 != g)
|
||||||
|
num_ranges++;
|
||||||
|
last = g;
|
||||||
|
count++;
|
||||||
|
}
|
||||||
u.format = count * 2 < num_ranges * 3 ? 1 : 2;
|
u.format = count * 2 < num_ranges * 3 ? 1 : 2;
|
||||||
|
|
||||||
switch (u.format)
|
switch (u.format)
|
||||||
|
|
Loading…
Reference in New Issue