Commit 91340c7a authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 7c87537a
No related merge requests found
// DO NOT EDIT - AUTOGENERATED (by gen-fsbtree from github.com/cznic/b bcff30a)
// DO NOT EDIT - AUTOGENERATED (by gen-fsbtree from github.com/cznic/b aaaa43c)
// KEY=zodb.Oid VALUE=int64
// ---- 8< ----
......@@ -830,13 +830,7 @@ func (e *Enumerator) Next() (k zodb.Oid, v int64, err error) {
}
if e.ver != e.t.ver {
f, hit := e.t.Seek(e.k)
if !e.hit && hit {
if err = f.next(); err != nil {
return
}
}
f, _ := e.t.Seek(e.k)
*e = *f
f.Close()
}
......@@ -853,7 +847,7 @@ func (e *Enumerator) Next() (k zodb.Oid, v int64, err error) {
i := e.q.d[e.i]
k, v = i.k, i.v
e.k, e.hit = k, false
e.k, e.hit = k, true
e.next()
return
}
......@@ -884,13 +878,7 @@ func (e *Enumerator) Prev() (k zodb.Oid, v int64, err error) {
}
if e.ver != e.t.ver {
f, hit := e.t.Seek(e.k)
if !e.hit && hit {
if err = f.prev(); err != nil {
return
}
}
f, _ := e.t.Seek(e.k)
*e = *f
f.Close()
}
......@@ -899,15 +887,22 @@ func (e *Enumerator) Prev() (k zodb.Oid, v int64, err error) {
return
}
if !e.hit {
// move to previous because Seek overshoots if there's no hit
if err = e.prev(); err != nil {
return
}
}
if e.i >= e.q.c {
if err = e.next(); err != nil {
if err = e.prev(); err != nil {
return
}
}
i := e.q.d[e.i]
k, v = i.k, i.v
e.k, e.hit = k, false
e.k, e.hit = k, true
e.prev()
return
}
......
// DO NOT EDIT - AUTOGENERATED (by gen-fsbtree from github.com/cznic/b bcff30a)
// DO NOT EDIT - AUTOGENERATED (by gen-fsbtree from github.com/cznic/b aaaa43c)
// ---- 8< ----
package fsb
import (
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment