From a954b5eb3af4a5927d5bb3bd7da3a6f430343358 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 10 Feb 2003 18:47:23 +0000 Subject: [PATCH] Modest speedup which seems to help steens quite a bit on large graphs git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5532 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/DataStructure/DataStructure.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Analysis/DataStructure/DataStructure.cpp b/lib/Analysis/DataStructure/DataStructure.cpp index ab18c4e11ad..dbe6623f010 100644 --- a/lib/Analysis/DataStructure/DataStructure.cpp +++ b/lib/Analysis/DataStructure/DataStructure.cpp @@ -906,7 +906,8 @@ void DSGraph::removeTriviallyDeadNodes() { if ((Node->NodeType & ~DSNode::DEAD) == 0 && Node->hasNoReferrers()) { // This node is dead! delete Node; // Free memory... - Nodes.erase(Nodes.begin()+i--); // Remove from node list... + Nodes[i--] = Nodes.back(); + Nodes.pop_back(); // Remove from node list... } } }