Don't save non-errors in the memstore iterator
As per the following link, io.EOF is returned to signal "no more items". Thus, we don't treat this as an error, and don't save it. https://godoc.org/github.com/cznic/b#Enumerator
This commit is contained in:
parent
52d0b8779a
commit
0355b89f54
1 changed files with 4 additions and 1 deletions
|
|
@ -15,6 +15,7 @@
|
|||
package memstore
|
||||
|
||||
import (
|
||||
"io"
|
||||
"math"
|
||||
|
||||
"github.com/google/cayley/graph"
|
||||
|
|
@ -121,7 +122,9 @@ func (it *Iterator) Next() bool {
|
|||
}
|
||||
result, _, err := it.iter.Next()
|
||||
if err != nil {
|
||||
if err != io.EOF {
|
||||
it.err = err
|
||||
}
|
||||
return graph.NextLogOut(it, nil, false)
|
||||
}
|
||||
if !it.checkValid(result) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue