From 63c6695108ceb19b4b79e00782c3106801d7dc01 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 18 May 2022 13:53:52 -0600 Subject: [PATCH] [ot-layout] Cosmetic The implementation of HBUINT16 operator == is slower than just comparing to ints. --- src/hb-ot-layout-common.hh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index 6bf30313b..4d3442f6b 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -2037,10 +2037,9 @@ struct ClassDefFormat1 } /* TODO Speed up, using set overlap first? */ /* TODO(iter) Rewrite as dagger. */ - HBUINT16 k {klass}; const HBUINT16 *arr = classValue.arrayZ; for (unsigned int i = 0; i < count; i++) - if (arr[i] == k && glyphs->has (startGlyph + i)) + if (arr[i] == klass && glyphs->has (startGlyph + i)) return true; return false; } @@ -2272,10 +2271,9 @@ struct ClassDefFormat2 } /* TODO Speed up, using set overlap first? */ /* TODO(iter) Rewrite as dagger. */ - HBUINT16 k {klass}; const RangeRecord *arr = rangeRecord.arrayZ; for (unsigned int i = 0; i < count; i++) - if (arr[i].value == k && arr[i].intersects (glyphs)) + if (arr[i].value == klass && arr[i].intersects (glyphs)) return true; return false; }