From a77a8575c5842010c04e3d04c0076358472dd7ed Mon Sep 17 00:00:00 2001 From: Anna Wiggins Date: Mon, 27 Jun 2011 20:37:46 -0400 Subject: [PATCH] Fixed crash on vertex_remove --- graph.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/graph.cpp b/graph.cpp index 3fcfa02..793373d 100644 --- a/graph.cpp +++ b/graph.cpp @@ -143,10 +143,9 @@ void Graph::remove_vertex(Vertex* target) for (cursor = target->neighbors.begin(); cursor != target->neighbors.end(); cursor++) { - Vertex* neighbor = *cursor; list::iterator subcursor = find(target->neighbors.begin(), target->neighbors.end(), - target); + *cursor); assert(subcursor != target->neighbors.end()); target->neighbors.erase(subcursor); }