mirror of
https://github.com/gonum/gonum.git
synced 2025-10-05 23:26:52 +08:00
graph: replace custom reverse logic with slices.Reverse
This commit is contained in:

committed by
Dan Kortschak

parent
1f5b2b5b54
commit
b94e4828e9
@@ -71,10 +71,3 @@ func LinesByIDs(n []graph.Line) {
|
||||
return n[i].ID() < n[j].ID()
|
||||
})
|
||||
}
|
||||
|
||||
// Reverse reverses the order of nodes.
|
||||
func Reverse(nodes []graph.Node) {
|
||||
for i, j := 0, len(nodes)-1; i < j; i, j = i+1, j-1 {
|
||||
nodes[i], nodes[j] = nodes[j], nodes[i]
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user