aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/Constants.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-07-11 20:58:19 +0000
committerDan Gohman <gohman@apple.com>2008-07-11 20:58:19 +0000
commitc418bf3dd593b5b2fe2f978930f6d0d6b17e344e (patch)
tree5dee06a8e718f8d3340454f695d3e6ba79acb1dc /lib/VMCore/Constants.cpp
parent78d60458d558877a5bf7e326511e302bcf75b8ee (diff)
Use find instead of lower_bound.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53474 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Constants.cpp')
-rw-r--r--lib/VMCore/Constants.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp
index dc9cab032c..a1158e34de 100644
--- a/lib/VMCore/Constants.cpp
+++ b/lib/VMCore/Constants.cpp
@@ -1100,9 +1100,9 @@ public:
/// necessary.
ConstantClass *getOrCreate(const TypeClass *Ty, const ValType &V) {
MapKey Lookup(Ty, V);
- typename MapTy::iterator I = Map.lower_bound(Lookup);
+ typename MapTy::iterator I = Map.find(Lookup);
// Is it in the map?
- if (I != Map.end() && I->first == Lookup)
+ if (I != Map.end())
return static_cast<ConstantClass *>(I->second);
// If no preexisting value, create one now...
@@ -1119,10 +1119,9 @@ public:
// If the type of the constant is abstract, make sure that an entry exists
// for it in the AbstractTypeMap.
if (Ty->isAbstract()) {
- typename AbstractTypeMapTy::iterator TI =
- AbstractTypeMap.lower_bound(Ty);
+ typename AbstractTypeMapTy::iterator TI = AbstractTypeMap.find(Ty);
- if (TI == AbstractTypeMap.end() || TI->first != Ty) {
+ if (TI == AbstractTypeMap.end()) {
// Add ourselves to the ATU list of the type.
cast<DerivedType>(Ty)->addAbstractTypeUser(this);