diff --git a/include/llvm/ADT/UniqueVector.h b/include/llvm/ADT/UniqueVector.h index e888678675e..93a9b1c6b50 100644 --- a/include/llvm/ADT/UniqueVector.h +++ b/include/llvm/ADT/UniqueVector.h @@ -56,10 +56,10 @@ public: /// not found. unsigned idFor(const T &Entry) const { // Search for entry in the map. - typename std::map::iterator MI = Map.lower_bound(Entry); + typename std::map::iterator MI = Map.find(Entry); // See if entry exists, if so return ID. - if (MI != Map.end() && MI->first == Entry) return MI->second; + if (MI != Map.end()) return MI->second; // No luck. return 0;