From 2884eb97bf448448c8c06f51e1a60acbff33bcbf Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 6 May 2022 12:54:02 -0600 Subject: [PATCH] [cff-common] Remove special-casing of count=0 in INDEX serialize The generic code-path now can handle count=0. --- src/hb-ot-cff-common.hh | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/hb-ot-cff-common.hh b/src/hb-ot-cff-common.hh index 50ab94547..7fc54d36d 100644 --- a/src/hb-ot-cff-common.hh +++ b/src/hb-ot-cff-common.hh @@ -172,18 +172,9 @@ struct CFFIndex Iterator it) { TRACE_SERIALIZE (this); - if (!it) - { - COUNT *dest = c->allocate_min (); - 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); }