diff options
Diffstat (limited to 'lib/pure/collections/tables.nim')
-rw-r--r-- | lib/pure/collections/tables.nim | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/pure/collections/tables.nim b/lib/pure/collections/tables.nim index 57e98bf5c..00a81b8d5 100644 --- a/lib/pure/collections/tables.nim +++ b/lib/pure/collections/tables.nim @@ -814,11 +814,14 @@ proc len*[A](t: CountTable[A]): int = ## returns the number of keys in `t`. result = t.counter -proc clear*[A](t: var CountTable[A] | CountTableRef[A]) = +proc clear*[A](t: CountTableRef[A]) = ## Resets the table so that it is empty. clearImpl() - t.counter = 0 +proc clear*[A](t: var CountTable[A]) = + ## Resets the table so that it is empty. + clearImpl() + iterator pairs*[A](t: CountTable[A]): (A, int) = ## iterates over any (key, value) pair in the table `t`. for h in 0..high(t.data): |