Update doc comments to mention rightSize.
This commit is contained in:
parent
a21d7c681d
commit
d129e8f6c6
2 changed files with 10 additions and 10 deletions
|
|
@ -313,9 +313,9 @@ proc init*[A](s: var HashSet[A], initialSize=64) =
|
||||||
## Initializes a hash set.
|
## Initializes a hash set.
|
||||||
##
|
##
|
||||||
## The `initialSize` parameter needs to be a power of two. You can use
|
## The `initialSize` parameter needs to be a power of two. You can use
|
||||||
## `math.nextPowerOfTwo() <math.html#nextPowerOfTwo>`_ to guarantee that at
|
## `math.nextPowerOfTwo() <math.html#nextPowerOfTwo>`_ or `rightSize` to
|
||||||
## runtime. All set variables have to be initialized before you can use them
|
## guarantee that at runtime. All set variables must be initialized before
|
||||||
## with other procs from this module with the exception of `isValid()
|
## use with other procs from this module with the exception of `isValid()
|
||||||
## <#isValid,TSet[A]>`_ and `len() <#len,TSet[A]>`_.
|
## <#isValid,TSet[A]>`_ and `len() <#len,TSet[A]>`_.
|
||||||
##
|
##
|
||||||
## You can call this proc on a previously initialized hash set, which will
|
## You can call this proc on a previously initialized hash set, which will
|
||||||
|
|
@ -719,9 +719,9 @@ proc init*[A](s: var OrderedSet[A], initialSize=64) =
|
||||||
## Initializes an ordered hash set.
|
## Initializes an ordered hash set.
|
||||||
##
|
##
|
||||||
## The `initialSize` parameter needs to be a power of two. You can use
|
## The `initialSize` parameter needs to be a power of two. You can use
|
||||||
## `math.nextPowerOfTwo() <math.html#nextPowerOfTwo>`_ to guarantee that at
|
## `math.nextPowerOfTwo() <math.html#nextPowerOfTwo>`_ or `rightSize` to
|
||||||
## runtime. All set variables have to be initialized before you can use them
|
## guarantee that at runtime. All set variables must be initialized before
|
||||||
## with other procs from this module with the exception of `isValid()
|
## use with other procs from this module with the exception of `isValid()
|
||||||
## <#isValid,TOrderedSet[A]>`_ and `len() <#len,TOrderedSet[A]>`_.
|
## <#isValid,TOrderedSet[A]>`_ and `len() <#len,TOrderedSet[A]>`_.
|
||||||
##
|
##
|
||||||
## You can call this proc on a previously initialized ordered hash set to
|
## You can call this proc on a previously initialized ordered hash set to
|
||||||
|
|
|
||||||
|
|
@ -294,7 +294,7 @@ proc initTable*[A, B](initialSize=64): Table[A, B] =
|
||||||
##
|
##
|
||||||
## `initialSize` needs to be a power of two. If you need to accept runtime
|
## `initialSize` needs to be a power of two. If you need to accept runtime
|
||||||
## values for this you could use the ``nextPowerOfTwo`` proc from the
|
## values for this you could use the ``nextPowerOfTwo`` proc from the
|
||||||
## `math <math.html>`_ module.
|
## `math <math.html>`_ module or the ``rightSize`` proc from this module.
|
||||||
assert isPowerOfTwo(initialSize)
|
assert isPowerOfTwo(initialSize)
|
||||||
result.counter = 0
|
result.counter = 0
|
||||||
newSeq(result.data, initialSize)
|
newSeq(result.data, initialSize)
|
||||||
|
|
@ -544,7 +544,7 @@ proc initOrderedTable*[A, B](initialSize=64): OrderedTable[A, B] =
|
||||||
##
|
##
|
||||||
## `initialSize` needs to be a power of two. If you need to accept runtime
|
## `initialSize` needs to be a power of two. If you need to accept runtime
|
||||||
## values for this you could use the ``nextPowerOfTwo`` proc from the
|
## values for this you could use the ``nextPowerOfTwo`` proc from the
|
||||||
## `math <math.html>`_ module.
|
## `math <math.html>`_ module or the ``rightSize`` proc from this module.
|
||||||
assert isPowerOfTwo(initialSize)
|
assert isPowerOfTwo(initialSize)
|
||||||
result.counter = 0
|
result.counter = 0
|
||||||
result.first = -1
|
result.first = -1
|
||||||
|
|
@ -675,7 +675,7 @@ proc newOrderedTable*[A, B](initialSize=64): OrderedTableRef[A, B] =
|
||||||
##
|
##
|
||||||
## `initialSize` needs to be a power of two. If you need to accept runtime
|
## `initialSize` needs to be a power of two. If you need to accept runtime
|
||||||
## values for this you could use the ``nextPowerOfTwo`` proc from the
|
## values for this you could use the ``nextPowerOfTwo`` proc from the
|
||||||
## `math <math.html>`_ module.
|
## `math <math.html>`_ module or the ``rightSize`` proc from this module.
|
||||||
new(result)
|
new(result)
|
||||||
result[] = initOrderedTable[A, B]()
|
result[] = initOrderedTable[A, B]()
|
||||||
|
|
||||||
|
|
@ -793,7 +793,7 @@ proc initCountTable*[A](initialSize=64): CountTable[A] =
|
||||||
##
|
##
|
||||||
## `initialSize` needs to be a power of two. If you need to accept runtime
|
## `initialSize` needs to be a power of two. If you need to accept runtime
|
||||||
## values for this you could use the ``nextPowerOfTwo`` proc from the
|
## values for this you could use the ``nextPowerOfTwo`` proc from the
|
||||||
## `math <math.html>`_ module or the ``rightSize`` method in this module.
|
## `math <math.html>`_ module or the ``rightSize`` proc in this module.
|
||||||
assert isPowerOfTwo(initialSize)
|
assert isPowerOfTwo(initialSize)
|
||||||
result.counter = 0
|
result.counter = 0
|
||||||
newSeq(result.data, initialSize)
|
newSeq(result.data, initialSize)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue