Tables: toCountTable: Update docs.
This commit is contained in:
parent
c36d7ffc7c
commit
b592f069bb
1 changed files with 2 additions and 1 deletions
|
|
@ -966,7 +966,8 @@ proc initCountTable*[A](initialSize=64): CountTable[A] =
|
||||||
newSeq(result.data, initialSize)
|
newSeq(result.data, initialSize)
|
||||||
|
|
||||||
proc toCountTable*[A](keys: openArray[A]): CountTable[A] =
|
proc toCountTable*[A](keys: openArray[A]): CountTable[A] =
|
||||||
## creates a new count table with every key in `keys` having a count of 1.
|
## creates a new count table with every key in `keys` having a count
|
||||||
|
## of how many times it occurs in `keys`.
|
||||||
result = initCountTable[A](rightSize(keys.len))
|
result = initCountTable[A](rightSize(keys.len))
|
||||||
for key in items(keys): result.inc key
|
for key in items(keys): result.inc key
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue