[cff-common] Remove special-casing of count=0 in INDEX serialize
The generic code-path now can handle count=0.
This commit is contained in:
parent
fc7f51aece
commit
2884eb97bf
|
@ -172,18 +172,9 @@ struct CFFIndex
|
||||||
Iterator it)
|
Iterator it)
|
||||||
{
|
{
|
||||||
TRACE_SERIALIZE (this);
|
TRACE_SERIALIZE (this);
|
||||||
if (!it)
|
serialize_header(c, + it | hb_map ([] (const byte_str_t &_) { return _.length; }));
|
||||||
{
|
for (const auto &_ : +it)
|
||||||
COUNT *dest = c->allocate_min<COUNT> ();
|
_.copy (c);
|
||||||
if (unlikely (!dest)) return_trace (false);
|
|
||||||
*dest = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
serialize_header(c, + it | hb_map ([] (const byte_str_t &_) { return _.length; }));
|
|
||||||
for (const auto &_ : +it)
|
|
||||||
_.copy (c);
|
|
||||||
}
|
|
||||||
return_trace (true);
|
return_trace (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue