Use find instead of lower_bound.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53474 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2008-07-11 20:58:19 +00:00
parent 78d60458d5
commit c418bf3dd5
6 changed files with 16 additions and 17 deletions

View File

@@ -185,8 +185,8 @@ void Timer::addPeakMemoryMeasurement() {
static ManagedStatic<std::map<std::string, Timer> > NamedTimers;
static Timer &getNamedRegionTimer(const std::string &Name) {
std::map<std::string, Timer>::iterator I = NamedTimers->lower_bound(Name);
if (I != NamedTimers->end() && I->first == Name)
std::map<std::string, Timer>::iterator I = NamedTimers->find(Name);
if (I != NamedTimers->end())
return I->second;
return NamedTimers->insert(I, std::make_pair(Name, Timer(Name)))->second;