Implement clear() for CountTableRef. Fixes #4325.

This commit is contained in:
Kier Davis 2016-06-13 17:00:32 +01:00
commit acbb03ee5e

View file

@ -754,7 +754,7 @@ proc len*[A](t: CountTable[A]): int =
## returns the number of keys in `t`. ## returns the number of keys in `t`.
result = t.counter result = t.counter
proc clear*[A](t: CountTable[A] | CountTable[A]) = proc clear*[A](t: CountTable[A] | CountTableRef[A]) =
## Resets the table so that it is empty. ## Resets the table so that it is empty.
clearImpl() clearImpl()
t.counter = 0 t.counter = 0