Fix wrong iteration in ListGraph snapshot, part II. (#598)
1.1 --- a/lemon/list_graph.h Fri May 22 17:44:29 2015 +0200
1.2 +++ b/lemon/list_graph.h Fri May 22 17:47:18 2015 +0200
1.3 @@ -2299,7 +2299,7 @@
1.4 snapshot.addNode(node);
1.5 }
1.6 virtual void add(const std::vector<Node>& nodes) {
1.7 - for (int i = nodes.size() - 1; i >= 0; ++i) {
1.8 + for (int i = nodes.size() - 1; i >= 0; --i) {
1.9 snapshot.addNode(nodes[i]);
1.10 }
1.11 }
1.12 @@ -2349,7 +2349,7 @@
1.13 snapshot.addEdge(edge);
1.14 }
1.15 virtual void add(const std::vector<Edge>& edges) {
1.16 - for (int i = edges.size() - 1; i >= 0; ++i) {
1.17 + for (int i = edges.size() - 1; i >= 0; --i) {
1.18 snapshot.addEdge(edges[i]);
1.19 }
1.20 }