[PATCH] D25705: [ADT] Compare strings' hashes first before comparing their values.

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 21 13:20:20 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL284872: [ADT] Compare strings' hashes first before comparing their values. (authored by jlebar).

Changed prior to commit:
  https://reviews.llvm.org/D25705?vs=74919&id=75477#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D25705

Files:
  llvm/trunk/include/llvm/ADT/CachedHashString.h


Index: llvm/trunk/include/llvm/ADT/CachedHashString.h
===================================================================
--- llvm/trunk/include/llvm/ADT/CachedHashString.h
+++ llvm/trunk/include/llvm/ADT/CachedHashString.h
@@ -61,7 +61,8 @@
   }
   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());
   }
 };
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25705.75477.patch
Type: text/x-patch
Size: 546 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161021/3337993b/attachment.bin>


More information about the llvm-commits mailing list