From 6f37c2079815bc0ac9193c8e9028da4872374402 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 18 May 2022 13:25:42 -0600 Subject: [PATCH] [subset] Minor rewrite in CoverageFormat2::serialize() --- src/hb-ot-layout-common.hh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index 6f02c87bb..a736dff28 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -1506,12 +1506,6 @@ struct CoverageFormat2 TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (this))) return_trace (false); - if (unlikely (!glyphs)) - { - rangeRecord.len = 0; - return_trace (true); - } - /* TODO(iter) Write more efficiently? */ unsigned num_ranges = 0; @@ -1524,6 +1518,7 @@ struct CoverageFormat2 } if (unlikely (!rangeRecord.serialize (c, num_ranges))) return_trace (false); + if (!num_ranges) return_trace (true); unsigned count = 0; unsigned range = (unsigned) -1;