From fc7f51aecea6b7a66772d4f759f52447f34197f1 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 6 May 2022 12:53:19 -0600 Subject: [PATCH] [cff-common] Reduce iterator calls --- src/hb-ot-cff-common.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-cff-common.hh b/src/hb-ot-cff-common.hh index a71b29777..50ab94547 100644 --- a/src/hb-ot-cff-common.hh +++ b/src/hb-ot-cff-common.hh @@ -172,7 +172,7 @@ struct CFFIndex Iterator it) { TRACE_SERIALIZE (this); - if (it.len () == 0) + if (!it) { COUNT *dest = c->allocate_min (); if (unlikely (!dest)) return_trace (false); @@ -217,7 +217,7 @@ struct CFFIndex if (!this->count) return_trace (true); if (unlikely (!c->extend (this->offSize))) return_trace (false); this->offSize = off_size; - if (unlikely (!c->allocate_size (off_size * (it.len () + 1)))) + if (unlikely (!c->allocate_size (off_size * (this->count + 1)))) return_trace (false); /* serialize indices */