Simplify Nexter interface
This change allows a Nexter to be used in the same manner as a scanner
using a for graph.Next(it) {} construction.
It is important that graph.Next(it) and any associated it.Result() calls
operate on the same iterator.
This commit is contained in:
parent
f8e28e066e
commit
b1a70d99aa
31 changed files with 168 additions and 233 deletions
|
|
@ -135,8 +135,8 @@ func (it *Fixed) Contains(v graph.Value) bool {
|
|||
return graph.ContainsLogOut(it, v, false)
|
||||
}
|
||||
|
||||
// Return the next stored value from the iterator.
|
||||
func (it *Fixed) Next() (graph.Value, bool) {
|
||||
// Next advances the iterator.
|
||||
func (it *Fixed) Next() bool {
|
||||
graph.NextLogIn(it)
|
||||
if it.lastIndex == len(it.values) {
|
||||
return graph.NextLogOut(it, nil, false)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue