diff options
author | Evan Martin <martine@danga.com> | 2012-08-01 15:49:35 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2012-08-01 15:49:35 (GMT) |
commit | ff877afa28f8fb1732b8183f1d7a26e16ba39113 (patch) | |
tree | 13adeb4d8f345ec6340940a31b9e40496e3c2f4d /src | |
parent | 080314c22ff73fd9e6bc085e0e7053a09a3a6592 (diff) | |
parent | 142fb71161f241e684e1a8ee4ecef22b61b14e0e (diff) | |
download | Ninja-ff877afa28f8fb1732b8183f1d7a26e16ba39113.zip Ninja-ff877afa28f8fb1732b8183f1d7a26e16ba39113.tar.gz Ninja-ff877afa28f8fb1732b8183f1d7a26e16ba39113.tar.bz2 |
Merge pull request #388 from sgraham/fix-hash-map-string-piece
fix hash_map StringPiece comparator
Diffstat (limited to 'src')
-rw-r--r-- | src/hash_map.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/hash_map.h b/src/hash_map.h index 658f699..88c2681 100644 --- a/src/hash_map.h +++ b/src/hash_map.h @@ -55,16 +55,16 @@ using stdext::hash_compare; struct StringPieceCmp : public hash_compare<StringPiece> { size_t operator()(const StringPiece& key) const { - return MurmurHash2(key.str(), key.len()); + 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 = strncmp(a.str_, b.str_, min(a.len_, b.len_)); if (cmp < 0) { return true; } else if (cmp > 0) { return false; } else { - return a.len() < b.len(); + return a.len_ < b.len_; } } }; |