mirror of
https://github.com/reactos/ninja.git
synced 2025-02-22 12:40:55 +00:00
Optimize StringPiece hash map
Replace strncmp with memcmp to improve performance. Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
This commit is contained in:
parent
2810ffb2b5
commit
41d2b035e2
@ -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 = strncmp(a.str_, b.str_, min(a.len_, b.len_));
|
||||
int cmp = memcmp(a.str_, b.str_, min(a.len_, b.len_));
|
||||
if (cmp < 0) {
|
||||
return true;
|
||||
} else if (cmp > 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user