mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-07 04:14:19 +00:00
Tables: toCountTable: Update docs.
This commit is contained in:
@@ -966,7 +966,8 @@ proc initCountTable*[A](initialSize=64): CountTable[A] =
|
||||
newSeq(result.data, initialSize)
|
||||
|
||||
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))
|
||||
for key in items(keys): result.inc key
|
||||
|
||||
|
||||
Reference in New Issue
Block a user