From 268eca24921e85eda98f4f0cce05d40c7235ba62 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 24 Nov 2018 01:11:12 -0500 Subject: [PATCH] [arrays] Port (unused) ArrayOf.lsearch() to hb_array_t's --- src/hb-open-type.hh | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh index 4e0c033fa..7fa38b1ca 100644 --- a/src/hb-open-type.hh +++ b/src/hb-open-type.hh @@ -548,20 +548,12 @@ struct ArrayOf template inline Type &lsearch (const T &x) { - unsigned int count = len; - for (unsigned int i = 0; i < count; i++) - if (!this->arrayZ[i].cmp (x)) - return this->arrayZ[i]; - return Crap (T); + return *as_array ().lsearch (x, &Crap (T)); } template inline const Type &lsearch (const T &x) const { - unsigned int count = len; - for (unsigned int i = 0; i < count; i++) - if (!this->arrayZ[i].cmp (x)) - return this->arrayZ[i]; - return Null (T); + return *as_array ().lsearch (x, &Null (T)); } inline void qsort (void)