Use find instead of lower_bounds.

llvm-svn: 25657
This commit is contained in:
Jim Laskey 2006-01-26 20:30:51 +00:00
parent ab8e0e40f9
commit bf023c019d

View File

@ -56,10 +56,10 @@ public:
/// not found.
unsigned idFor(const T &Entry) const {
// Search for entry in the map.
typename std::map<T, unsigned>::iterator MI = Map.lower_bound(Entry);
typename std::map<T, unsigned>::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;