Update vendor/
This commit is contained in:
11
vendor/github.com/asdine/storm/internal/boltdb.go
generated
vendored
11
vendor/github.com/asdine/storm/internal/boltdb.go
generated
vendored
@@ -42,7 +42,16 @@ type RangeCursor struct {
|
||||
// First element
|
||||
func (c *RangeCursor) First() ([]byte, []byte) {
|
||||
if c.Reverse {
|
||||
return c.C.Seek(c.Max)
|
||||
k, v := c.C.Seek(c.Max)
|
||||
|
||||
// If Seek doesn't find a key it goes to the next.
|
||||
// If so, we need to get the previous one to avoid
|
||||
// including bigger values. #218
|
||||
if !bytes.HasPrefix(k, c.Max) && k != nil {
|
||||
k, v = c.C.Prev()
|
||||
}
|
||||
|
||||
return k, v
|
||||
}
|
||||
|
||||
return c.C.Seek(c.Min)
|
||||
|
Reference in New Issue
Block a user