From 06d3c2019fc2dd9a284a3c2471a1eabef47584c5 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 6 Dec 2019 02:52:54 +0000 Subject: [PATCH] [array] Simplify bfind() positioning I had copied the old scheme from fontconfig's fccharset.c. I just convinced myself that this change is correct and produces exact same results. But I also am skeptical. Anyone else feel like convincing themselves as well please? --- src/hb-array.hh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/hb-array.hh b/src/hb-array.hh index 0bce8d436..4353772e9 100644 --- a/src/hb-array.hh +++ b/src/hb-array.hh @@ -330,9 +330,7 @@ struct hb_sorted_array_t : break; case HB_BFIND_NOT_FOUND_STORE_CLOSEST: - if (max < 0 || (max < (int) this->length && array[max].cmp (x) > 0)) - max++; - *i = max; + *i = min; break; } }