From 918b1ee54d43eb493c9226bff7677ed8ec07934b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 24 Nov 2018 10:09:17 -0500 Subject: [PATCH] [arrays] Add not_found to reference bsearch as well --- src/hb-open-type.hh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh index 1c810e712..2e3db31df 100644 --- a/src/hb-open-type.hh +++ b/src/hb-open-type.hh @@ -469,11 +469,11 @@ struct SortedUnsizedArrayOf : UnsizedArrayOf { return hb_sorted_array (this->arrayZ, len); } template - inline Type &bsearch (unsigned int len, const T &x) - { return *as_array (len).bsearch (x, &Crap (Type)); } + inline Type &bsearch (unsigned int len, const T &x, Type ¬_found = Crap (Type)) + { return *as_array (len).bsearch (x, ¬_found); } template - inline const Type &bsearch (unsigned int len, const T &x) const - { return *as_array (len).bsearch (x, &Null (Type)); } + inline const Type &bsearch (unsigned int len, const T &x, const Type ¬_found = Null (Type)) const + { return *as_array (len).bsearch (x, ¬_found); } template inline bool bfind (unsigned int len, const T &x, unsigned int *i = nullptr, hb_bfind_not_found_t not_found = HB_BFIND_NOT_FOUND_DONT_STORE, @@ -778,11 +778,11 @@ struct SortedArrayOf : ArrayOf { return hb_sorted_array (this->arrayZ, this->len); } template - inline Type &bsearch (const T &x) - { return *as_array ().bsearch (x, &Crap (Type)); } + inline Type &bsearch (const T &x, Type ¬_found = Crap (Type)) + { return *as_array ().bsearch (x, ¬_found); } template - inline const Type &bsearch (const T &x) const - { return *as_array ().bsearch (x, &Null (Type)); } + inline const Type &bsearch (const T &x, const Type ¬_found = Null (Type)) const + { return *as_array ().bsearch (x, ¬_found); } template inline bool bfind (const T &x, unsigned int *i = nullptr, hb_bfind_not_found_t not_found = HB_BFIND_NOT_FOUND_DONT_STORE,