mirror of
https://github.com/gonum/gonum.git
synced 2025-10-07 16:11:03 +08:00
graph/iterator: extend iteration tests and fix counting error
This commit is contained in:
@@ -24,10 +24,7 @@ func (n *OrderedNodes) Len() int {
|
||||
if n.idx >= len(n.nodes) {
|
||||
return 0
|
||||
}
|
||||
if n.idx <= 0 {
|
||||
return len(n.nodes)
|
||||
}
|
||||
return len(n.nodes[n.idx:])
|
||||
return len(n.nodes[n.idx+1:])
|
||||
}
|
||||
|
||||
// Next returns whether the next call of Node will return a valid node.
|
||||
|
Reference in New Issue
Block a user