From 7cdde6a24174ea2f29da141bcb265feb9b15eb2b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 21 Jul 2022 17:17:59 -0600 Subject: [PATCH] [ClassDef] Write a loop as range for --- src/hb-ot-layout-common.hh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index 8f741745d..202be0bf3 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -1810,11 +1810,8 @@ struct ClassDefFormat2_4 return true; /* Fall through. */ } - /* TODO Speed up, using set overlap first? */ - /* TODO(iter) Rewrite as dagger. */ - const auto *arr = rangeRecord.arrayZ; - for (unsigned int i = 0; i < count; i++) - if (arr[i].value == klass && arr[i].intersects (*glyphs)) + for (const auto &range : rangeRecord) + if (range.value == klass && range.intersects (*glyphs)) return true; return false; }