Use find instead of lower_bounds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25657 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Laskey 2006-01-26 20:30:51 +00:00
parent bc9ae377d9
commit 3e0be526bf

View File

@ -56,10 +56,10 @@ public:
/// not found. /// not found.
unsigned idFor(const T &Entry) const { unsigned idFor(const T &Entry) const {
// Search for entry in the map. // 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. // 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. // No luck.
return 0; return 0;