Fix wrong iteration in ListGraph snapshot, part II. (#598)
authorAlpar Juttner <alpar@cs.elte.hu>
Fri, 22 May 2015 17:47:18 +0200
changeset 11482126945deb6a
parent 1147 138714057145
child 1149 3ec484b11733
child 1174 7c86f14b3bc5
Fix wrong iteration in ListGraph snapshot, part II. (#598)
lemon/list_graph.h
     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          }