OSDN Git Service

Reduce number of set operations.
authorChris Lattner <sabre@nondot.org>
Sun, 12 Dec 2004 22:16:13 +0000 (22:16 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 12 Dec 2004 22:16:13 +0000 (22:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18839 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/ADCE.cpp

index 22b4c34..c7d3499 100644 (file)
@@ -91,9 +91,8 @@ private:
   TerminatorInst *convertToUnconditionalBranch(TerminatorInst *TI);
 
   inline void markInstructionLive(Instruction *I) {
-    if (LiveSet.count(I)) return;
+    if (!LiveSet.insert(I).second) return;
     DEBUG(std::cerr << "Insn Live: " << *I);
-    LiveSet.insert(I);
     WorkList.push_back(I);
   }