Skip to content

Commit

Permalink
Only apply NaiveOffset and NaiveLimit when appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelavila committed Mar 22, 2019
1 parent 2cec99f commit bff153a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mount/mount.go
Expand Up @@ -262,7 +262,15 @@ func (d *Datastore) Query(q query.Query) (query.Results, error) {
Close: queries.close,
})

return query.NaiveLimit(query.NaiveOffset(qr, offset), q.Limit), nil
if offset > 0 {
qr = query.NaiveOffset(qr, offset)
}

if q.Limit > 0 {
qr = query.NaiveLimit(qr, q.Limit)
}

return qr, nil
}

func (d *Datastore) Close() error {
Expand Down

0 comments on commit bff153a

Please sign in to comment.