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:
56ef4e0
)
[set] Speed up intersects()
author
Behdad Esfahbod
<behdad@behdad.org>
Sun, 15 Oct 2017 20:56:05 +0000
(16:56 -0400)
committer
Behdad Esfahbod
<behdad@behdad.org>
Sun, 15 Oct 2017 20:56:05 +0000
(16:56 -0400)
src/hb-set-private.hh
patch
|
blob
|
history
diff --git
a/src/hb-set-private.hh
b/src/hb-set-private.hh
index
7bb57d9
..
9cd15d5
100644
(file)
--- a/
src/hb-set-private.hh
+++ b/
src/hb-set-private.hh
@@
-238,12
+238,8
@@
struct hb_set_t
inline bool intersects (hb_codepoint_t first,
hb_codepoint_t last) const
{
- /* TODO Speedup */
- unsigned int end = last + 1;
- for (hb_codepoint_t i = first; i < end; i++)
- if (has (i))
- return true;
- return false;
+ hb_codepoint_t c = first - 1;
+ return next (&c) && c <= last;
}
inline void set (const hb_set_t *other)
{