Skip to content

Commit

Permalink
fix(query): use the correct size when skipping
Browse files Browse the repository at this point in the history
  • Loading branch information
Stebalien committed Dec 2, 2019
1 parent 1485448 commit d2d1cd4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,11 @@ func (t *txn) query(q dsq.Query) (dsq.Results, error) {

matches := true
check := func(value []byte) error {
e := dsq.Entry{Key: string(item.Key()), Value: value, Size:len(value)}
e := dsq.Entry{
Key: string(item.Key()),
Value: value,
Size: int(item.ValueSize()), // this function is basically free
}

// Only calculate expirations if we need them.
if q.ReturnExpirations {
Expand Down

0 comments on commit d2d1cd4

Please sign in to comment.