complement notes of two doc strings of tables module (#18527)

* complement notes of two doc strings warning the deprecated  procedure's side effect

* Update lib/pure/collections/tables.nim

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

* Update lib/pure/collections/tables.nim

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

Co-authored-by: BillyZee <billyzee@localhost.localdomain>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
This commit is contained in:
IterableTrucks 2021-07-21 20:13:50 +08:00 • committed by GitHub
commit 880353c0ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -496,6 +496,8 @@ template tabCellHash(i) = t.data[i].hcode
proc del*[A, B](t: var Table[A, B], key: A) = proc del*[A, B](t: var Table[A, B], key: A) =
## Deletes `key` from hash table `t`. Does nothing if the key does not exist. ## Deletes `key` from hash table `t`. Does nothing if the key does not exist.
## ##
## .. warning:: If duplicate keys were added, this may need to be called multiple times.
##
## See also: ## See also:
## * `pop proc<#pop,Table[A,B],A,B>`_ ## * `pop proc<#pop,Table[A,B],A,B>`_
## * `clear proc<#clear,Table[A,B]>`_ to empty the whole table ## * `clear proc<#clear,Table[A,B]>`_ to empty the whole table
@ -514,6 +516,8 @@ proc pop*[A, B](t: var Table[A, B], key: A, val: var B): bool =
## mapping of the key. Otherwise, returns `false`, and the `val` is ## mapping of the key. Otherwise, returns `false`, and the `val` is
## unchanged. ## unchanged.
## ##
## .. warning:: If duplicate keys were added, this may need to be called multiple times.
##
## See also: ## See also:
## * `del proc<#del,Table[A,B],A>`_ ## * `del proc<#del,Table[A,B],A>`_
## * `clear proc<#clear,Table[A,B]>`_ to empty the whole table ## * `clear proc<#clear,Table[A,B]>`_ to empty the whole table