Skip to content

Commit

Permalink
Merge pull request #1014 from moroten/optimize-stringpiece
Browse files Browse the repository at this point in the history
Optimize StringPiece hash map
  • Loading branch information
nico committed Sep 7, 2015
2 parents cb17a11 + 41d2b03 commit a484344
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hash_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a484344

Please sign in to comment.