diff options
author | Paweł Świątkowski <pawel.swiatkowski@fyber.com> | 2016-12-11 19:05:39 +0100 |
---|---|---|
committer | Paweł Świątkowski <pawel.swiatkowski@fyber.com> | 2016-12-11 19:05:39 +0100 |
commit | 11db362d86a96f05b65eb96c4a59f5e6de688410 (patch) | |
tree | 23601f574e173c2917a27e77526b74942eaca75f /lib | |
parent | 9099fdd8f02b83670ae0ca8a5e434499c56c9904 (diff) | |
download | Nim-11db362d86a96f05b65eb96c4a59f5e6de688410.tar.gz |
Fix description of CountTable's smallest proc
Diffstat (limited to 'lib')
-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) = |