forked from OSchip/llvm-project
[ADT] Compare strings' hashes first before comparing their values.
Summary: We already have the hashes in hand, and comparing hashes should be much more discriminatory than comparing the StringRefs' sizes. Reviewers: rafael Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D25705 llvm-svn: 284872
This commit is contained in:
parent
d87ea9a1c9
commit
c9d66eb05b
|
@ -61,7 +61,8 @@ template <> struct DenseMapInfo<CachedHashStringRef> {
|
||||||
}
|
}
|
||||||
static bool isEqual(const CachedHashStringRef &LHS,
|
static bool isEqual(const CachedHashStringRef &LHS,
|
||||||
const CachedHashStringRef &RHS) {
|
const CachedHashStringRef &RHS) {
|
||||||
return DenseMapInfo<StringRef>::isEqual(LHS.val(), RHS.val());
|
return LHS.hash() == RHS.hash() &&
|
||||||
|
DenseMapInfo<StringRef>::isEqual(LHS.val(), RHS.val());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue