mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-11 23:31:03 +00:00
off by one bug in all
This commit is contained in:
parent
3be3c1f4c5
commit
5557f529a7
1 changed files with 2 additions and 2 deletions
|
|
@ -224,7 +224,7 @@ func dump(r RankList, n int) {
|
|||
func (self *Brand) TopNAll(n int, categories []uint64) []Pair {
|
||||
|
||||
self.checkRank()
|
||||
results := make([]Pair, n)
|
||||
results := make([]Pair, n+1)
|
||||
|
||||
category := NewIntSet()
|
||||
needCat := false
|
||||
|
|
@ -241,7 +241,7 @@ func (self *Brand) TopNAll(n int, categories []uint64) []Pair {
|
|||
}
|
||||
}
|
||||
|
||||
if count > n {
|
||||
if count >= n {
|
||||
break
|
||||
}
|
||||
results[count] = Pair{pair.Key, pair.Count}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue