Skip to content

Commit 2fb4c5a

Browse files
committed
clean
1 parent 8caabf1 commit 2fb4c5a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

include/prim_mst.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,12 @@ namespace alg {
7373

7474
while (!Q.is_empty()) {
7575
Heap<uint32_t>::elem e = Q.pop();
76-
Graph::Adjacent * u = g[e.data]; // the vertex to process
76+
uint32_t id = e.data;
77+
Graph::Adjacent * u = g[id]; // the vertex to process
7778
Graph::Vertex * v;
7879
list_for_each_entry(v, &u->v_head, v_node) {
7980
if (Q.contains(v->id) && v->weight < keys[v->id]) {
80-
pi[v->id] = e.data;
81+
pi[v->id] = id;
8182
Q.decrease_key(v->id, v->weight);
8283
keys[v->id] = v->weight;
8384
}

0 commit comments

Comments
 (0)