... | ... |
@@ -120,20 +120,20 @@ |
120 | 120 |
void first(Arc& arc) const { |
121 | 121 |
int n; |
122 | 122 |
for(n = first_node; |
123 |
n!=-1 && nodes[n]. |
|
123 |
n != -1 && nodes[n].first_out == -1; |
|
124 | 124 |
n = nodes[n].next) {} |
125 |
arc.id = (n == -1) ? -1 : nodes[n]. |
|
125 |
arc.id = (n == -1) ? -1 : nodes[n].first_out; |
|
126 | 126 |
} |
127 | 127 |
|
128 | 128 |
void next(Arc& arc) const { |
129 |
if (arcs[arc.id].next_in != -1) { |
|
130 |
arc.id = arcs[arc.id].next_in; |
|
129 |
if (arcs[arc.id].next_out != -1) { |
|
130 |
arc.id = arcs[arc.id].next_out; |
|
131 | 131 |
} else { |
132 | 132 |
int n; |
133 |
for(n = nodes[arcs[arc.id].target].next; |
|
134 |
n!=-1 && nodes[n].first_in == -1; |
|
133 |
for(n = nodes[arcs[arc.id].source].next; |
|
134 |
n != -1 && nodes[n].first_out == -1; |
|
135 | 135 |
n = nodes[n].next) {} |
136 |
arc.id = (n == -1) ? -1 : nodes[n]. |
|
136 |
arc.id = (n == -1) ? -1 : nodes[n].first_out; |
|
137 | 137 |
} |
138 | 138 |
} |
139 | 139 |
|
0 comments (0 inline)