# HG changeset patch # User Peter Kovacs # Date 1254134924 -7200 # Node ID 32baeb8e5c8fc2cec7dd167588af17a1777b3c8b # Parent fb93895f84d9050f68f4e9db6f3d70da4038be69 Modify the implementation of ListDigraph::ArcIt (#311) The new implementation is based on out-arc iteration (like ListGraph::ArcIt) instead of in-arc iteration to make it consistent with the documentation. diff -r fb93895f84d9 -r 32baeb8e5c8f lemon/list_graph.h --- a/lemon/list_graph.h Thu Aug 20 22:52:16 2009 +0200 +++ b/lemon/list_graph.h Mon Sep 28 12:48:44 2009 +0200 @@ -116,20 +116,20 @@ void first(Arc& arc) const { int n; for(n = first_node; - n!=-1 && nodes[n].first_in == -1; + n != -1 && nodes[n].first_out == -1; n = nodes[n].next) {} - arc.id = (n == -1) ? -1 : nodes[n].first_in; + arc.id = (n == -1) ? -1 : nodes[n].first_out; } void next(Arc& arc) const { - if (arcs[arc.id].next_in != -1) { - arc.id = arcs[arc.id].next_in; + if (arcs[arc.id].next_out != -1) { + arc.id = arcs[arc.id].next_out; } else { int n; - for(n = nodes[arcs[arc.id].target].next; - n!=-1 && nodes[n].first_in == -1; + for(n = nodes[arcs[arc.id].source].next; + n != -1 && nodes[n].first_out == -1; n = nodes[n].next) {} - arc.id = (n == -1) ? -1 : nodes[n].first_in; + arc.id = (n == -1) ? -1 : nodes[n].first_out; } }