projects
/
platform
/
upstream
/
ninja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2810ffb
)
Optimize StringPiece hash map
author
Fredrik Medley
<fredrik.medley@gmail.com>
Fri, 12 Jun 2015 21:59:12 +0000
(23:59 +0200)
committer
Fredrik Medley
<fredrik.medley@gmail.com>
Thu, 3 Sep 2015 20:19:25 +0000
(22:19 +0200)
Replace strncmp with memcmp to improve performance.
Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
src/hash_map.h
patch
|
blob
|
history
diff --git
a/src/hash_map.h
b/src/hash_map.h
index
abdba92
..
a91aeb9
100644
(file)
--- a/
src/hash_map.h
+++ b/
src/hash_map.h
@@
-76,7
+76,7
@@
struct StringPieceCmp : public hash_compare<StringPiece> {
return MurmurHash2(key.str_, key.len_);
}
bool operator()(const StringPiece& a, const StringPiece& b) const {
- int cmp =
strn
cmp(a.str_, b.str_, min(a.len_, b.len_));
+ int cmp =
mem
cmp(a.str_, b.str_, min(a.len_, b.len_));
if (cmp < 0) {
return true;
} else if (cmp > 0) {