gravatar
alpar (Alpar Juttner)
alpar@cs.elte.hu
Merge
0 1 0
merge default
1 file changed with 7 insertions and 7 deletions:
↑ Collapse diff ↑
Ignore white space 6 line context
... ...
@@ -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].first_in == -1;
123
          n != -1 && nodes[n].first_out == -1;
124 124
          n = nodes[n].next) {}
125
      arc.id = (n == -1) ? -1 : nodes[n].first_in;
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].first_in;
136
        arc.id = (n == -1) ? -1 : nodes[n].first_out;
137 137
      }
138 138
    }
139 139

	
0 comments (0 inline)