This speeds up processing LLVM a _lot_, 17% in the case of loading and destroying...
authorChris Lattner <sabre@nondot.org>
Thu, 13 Feb 2003 19:46:22 +0000 (19:46 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 13 Feb 2003 19:46:22 +0000 (19:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5553 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Value.cpp

index f343a6c1551e85a197caa0a512b605e487945c53..ac13159e30aa9f5d53930b055a1c6dcf827aa25e 100644 (file)
@@ -89,7 +89,8 @@ void Value::killUse(User *U) {
     /* empty */;
 
   assert(i < Uses.size() && "Use not in uses list!!");
-  Uses.erase(Uses.begin()+i);
+  Uses[i] = Uses.back();
+  Uses.pop_back();
 }
 
 //===----------------------------------------------------------------------===//