diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-12-11 19:58:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-11 19:58:11 +0100 |
commit | 087a26ff2111ef310daff7961c10ade5600012b7 (patch) | |
tree | 23601f574e173c2917a27e77526b74942eaca75f | |
parent | 9099fdd8f02b83670ae0ca8a5e434499c56c9904 (diff) | |
parent | 11db362d86a96f05b65eb96c4a59f5e6de688410 (diff) | |
download | Nim-087a26ff2111ef310daff7961c10ade5600012b7.tar.gz |
Merge pull request #5115 from katafrakt/smallest-description
Fix description of CountTable's smallest
-rw-r--r-- | lib/pure/collections/tables.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pure/collections/tables.nim b/lib/pure/collections/tables.nim index e6e72d9ed..57e98bf5c 100644 --- a/lib/pure/collections/tables.nim +++ b/lib/pure/collections/tables.nim @@ -954,7 +954,7 @@ proc inc*[A](t: var CountTable[A], key: A, val = 1) = inc(t.counter) proc smallest*[A](t: CountTable[A]): tuple[key: A, val: int] = - ## returns the largest (key,val)-pair. Efficiency: O(n) + ## returns the (key,val)-pair with the smallest `val`. Efficiency: O(n) assert t.len > 0 var minIdx = 0 for h in 1..high(t.data): @@ -1080,7 +1080,7 @@ proc inc*[A](t: CountTableRef[A], key: A, val = 1) = t[].inc(key, val) proc smallest*[A](t: CountTableRef[A]): (A, int) = - ## returns the largest (key,val)-pair. Efficiency: O(n) + ## returns the (key,val)-pair with the smallest `val`. Efficiency: O(n) t[].smallest proc largest*[A](t: CountTableRef[A]): (A, int) = |