Fixed crash on vertex_remove

This commit is contained in:
Anna Rose 2011-06-27 20:37:46 -04:00
parent 39db9b6c12
commit a77a8575c5

View File

@ -143,10 +143,9 @@ void Graph::remove_vertex(Vertex* target)
for (cursor = target->neighbors.begin(); cursor != target->neighbors.end();
cursor++)
{
Vertex* neighbor = *cursor;
list<Vertex*>::iterator subcursor = find(target->neighbors.begin(),
target->neighbors.end(),
target);
*cursor);
assert(subcursor != target->neighbors.end());
target->neighbors.erase(subcursor);
}