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:
893991f
)
Speed up Speed up hb_set_digest_common_bits_t calcs
author
Behdad Esfahbod
<behdad@behdad.org>
Wed, 17 Apr 2013 03:13:10 +0000
(23:13 -0400)
committer
Behdad Esfahbod
<behdad@behdad.org>
Wed, 17 Apr 2013 03:13:10 +0000
(23:13 -0400)
Correctly this time.
src/hb-set-private.hh
patch
|
blob
|
history
diff --git
a/src/hb-set-private.hh
b/src/hb-set-private.hh
index
d9e0d29
..
8f741b0
100644
(file)
--- a/
src/hb-set-private.hh
+++ b/
src/hb-set-private.hh
@@
-54,9
+54,11
@@
struct hb_set_digest_common_bits_t
}
inline void add_range (hb_codepoint_t a, hb_codepoint_t b) {
- /* TODO Speedup. */
- for (unsigned int i = a; i < b + 1; i++)
- add (i);
+ add (a);
+ /* The negation here stands for ~(x-1). */
+ mask_t upper_bits = -(1 << _hb_bit_storage (a ^ b));
+ mask &= upper_bits;
+ value &= upper_bits;
}
inline bool may_have (hb_codepoint_t g) const {