Reduce double set lookups.
[oota-llvm.git] / lib / Analysis / LazyValueInfo.cpp
index 87c31fd9b68b0ff50a61ef367a2dd697fd0ff1c3..d4580dcee84c0ee5b1d8dc138de60a9dba3e931b 100644 (file)
@@ -346,11 +346,10 @@ namespace {
     /// Push BV onto BlockValueStack unless it's already in there.
     /// Returns true on success.
     bool pushBlockValue(const std::pair<BasicBlock *, Value *> &BV) {
-      if (BlockValueSet.count(BV))
+      if (!BlockValueSet.insert(BV).second)
         return false;  // It's already in the stack.
 
       BlockValueStack.push(BV);
-      BlockValueSet.insert(BV);
       return true;
     }