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:
Andrew Dunham 2015-04-15 11:46:26 -07:00
parent 52d0b8779a
commit 0355b89f54

View file

@ -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) {