Skip to content

Commit

Permalink
graph: fix undirected to directed copy behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
kortschak committed Feb 14, 2018
1 parent 996b88e commit 326fd9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions graph/graph.go
Expand Up @@ -218,7 +218,7 @@ func Copy(dst Builder, src Graph) {
}
for _, u := range nodes {
for _, v := range src.From(u) {
dst.SetEdge(src.Edge(u, v))
dst.SetEdge(dst.NewEdge(u, v))
}
}
}
Expand All @@ -241,7 +241,7 @@ func CopyWeighted(dst WeightedBuilder, src Weighted) {
}
for _, u := range nodes {
for _, v := range src.From(u) {
dst.SetWeightedEdge(src.WeightedEdge(u, v))
dst.SetWeightedEdge(dst.NewWeightedEdge(u, v, src.WeightedEdge(u, v).Weight()))
}
}
}

0 comments on commit 326fd9d

Please sign in to comment.