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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284872
91177308-0d34-0410-b5e6-
96231b3b80d8
}
static bool isEqual(const CachedHashStringRef &LHS,
const CachedHashStringRef &RHS) {
- return DenseMapInfo<StringRef>::isEqual(LHS.val(), RHS.val());
+ return LHS.hash() == RHS.hash() &&
+ DenseMapInfo<StringRef>::isEqual(LHS.val(), RHS.val());
}
};