[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:
Behdad Esfahbod 2022-05-06 12:54:02 -06:00
parent fc7f51aece
commit 2884eb97bf
1 changed files with 3 additions and 12 deletions

View File

@ -172,18 +172,9 @@ struct CFFIndex
Iterator it)
{
TRACE_SERIALIZE (this);
if (!it)
{
COUNT *dest = c->allocate_min<COUNT> ();
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);
}
serialize_header(c, + it | hb_map ([] (const byte_str_t &_) { return _.length; }));
for (const auto &_ : +it)
_.copy (c);
return_trace (true);
}