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); }