mirror of
https://github.com/gonum/gonum.git
synced 2025-10-06 15:47:01 +08:00
graph: use iterators directly rather than copying into []graph.Node
There are still uses in test code; these can remain since they simplify that code.
This commit is contained in:
@@ -62,7 +62,9 @@ func AStar(s, t graph.Node, g traverse.Graph, h Heuristic) (path Shortest, expan
|
||||
}
|
||||
|
||||
visited.Add(uid)
|
||||
for _, v := range graph.NodesOf(g.From(u.node.ID())) {
|
||||
to := g.From(u.node.ID())
|
||||
for to.Next() {
|
||||
v := to.Node()
|
||||
vid := v.ID()
|
||||
if visited.Has(vid) {
|
||||
continue
|
||||
|
Reference in New Issue
Block a user