Merge with new Next() interface

This commit is contained in:
Barak Michener 2014-08-10 17:59:09 -04:00
commit a1e5a53dd5
48 changed files with 677 additions and 654 deletions

View file

@ -125,19 +125,19 @@ func (it *Iterator) isLiveValue(val []byte) bool {
return len(entry.History)%2 != 0
}
func (it *Iterator) Next() (graph.Value, bool) {
func (it *Iterator) Next() bool {
if it.iter == nil {
it.result = nil
return nil, false
return false
}
if !it.open {
it.result = nil
return nil, false
return false
}
if !it.iter.Valid() {
it.result = nil
it.Close()
return nil, false
return false
}
if bytes.HasPrefix(it.iter.Key(), it.nextPrefix) {
if !it.isLiveValue(it.iter.Value()) {
@ -150,11 +150,11 @@ func (it *Iterator) Next() (graph.Value, bool) {
if !ok {
it.Close()
}
return Token(out), true
return true
}
it.Close()
it.result = nil
return nil, false
return false
}
func (it *Iterator) ResultTree() *graph.ResultTree {
@ -165,7 +165,7 @@ func (it *Iterator) Result() graph.Value {
return it.result
}
func (it *Iterator) NextResult() bool {
func (it *Iterator) NextPath() bool {
return false
}