projects
/
platform
/
upstream
/
libHarfBuzzSharp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
41b1984
)
[bsearch] Micro-optimization
author
Behdad Esfahbod
<behdad@behdad.org>
Tue, 17 Oct 2017 23:32:12 +0000
(16:32 -0700)
committer
Behdad Esfahbod
<behdad@behdad.org>
Tue, 17 Oct 2017 23:32:12 +0000
(16:32 -0700)
src/hb-open-type-private.hh
patch
|
blob
|
history
diff --git
a/src/hb-open-type-private.hh
b/src/hb-open-type-private.hh
index
bed5eea
..
f25341a
100644
(file)
--- a/
src/hb-open-type-private.hh
+++ b/
src/hb-open-type-private.hh
@@
-1047,11
+1047,12
@@
struct SortedArrayOf : ArrayOf<Type, LenType>
inline int bsearch (const SearchType &x) const
{
/* Hand-coded bsearch here since this is in the hot inner loop. */
+ const Type *array = this->array;
int min = 0, max = (int) this->len - 1;
while (min <= max)
{
int mid = (min + max) / 2;
- int c =
this->
array[mid].cmp (x);
+ int c = array[mid].cmp (x);
if (c < 0)
max = mid - 1;
else if (c > 0)