incorrect handling of large topns

This commit is contained in:
Todd Gruben 2017-02-28 14:01:30 -06:00
parent 5ef4d6fa6b
commit 62a59f2bd1

View file

@ -194,7 +194,10 @@ func (e *Executor) executeTopN(ctx context.Context, db string, c *pql.Call, slic
if x != nil {
return nil, x
}
trimedlist = trimedlist[0:n]
if int(n) < len(trimedlist) {
trimedlist = trimedlist[0:n]
}
return trimedlist, nil
}