fixes #15021
This commit is contained in:
parent
c4e03b540e
commit
9e4920c068
1 changed files with 2 additions and 2 deletions
|
|
@ -2298,7 +2298,7 @@ proc smallest*[A](t: CountTable[A]): tuple[key: A, val: int] =
|
|||
##
|
||||
## See also:
|
||||
## * `largest proc<#largest,CountTable[A]>`_
|
||||
assert t.len > 0
|
||||
assert t.len > 0, "counttable is empty"
|
||||
var minIdx = -1
|
||||
for h in 0 .. high(t.data):
|
||||
if t.data[h].val > 0 and (minIdx == -1 or t.data[minIdx].val > t.data[h].val):
|
||||
|
|
@ -2311,7 +2311,7 @@ proc largest*[A](t: CountTable[A]): tuple[key: A, val: int] =
|
|||
##
|
||||
## See also:
|
||||
## * `smallest proc<#smallest,CountTable[A]>`_
|
||||
assert t.len > 0
|
||||
assert t.len > 0, "counttable is empty"
|
||||
var maxIdx = 0
|
||||
for h in 1 .. high(t.data):
|
||||
if t.data[maxIdx].val < t.data[h].val: maxIdx = h
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue