deprecate tables.add (#15047)
This commit is contained in:
parent
2dddf32726
commit
1330597f6d
1 changed files with 8 additions and 4 deletions
|
|
@ -484,7 +484,8 @@ proc len*[A, B](t: Table[A, B]): int =
|
|||
|
||||
result = t.counter
|
||||
|
||||
proc add*[A, B](t: var Table[A, B], key: A, val: B) =
|
||||
proc add*[A, B](t: var Table[A, B], key: A, val: B) {.deprecated:
|
||||
"Deprecated since v1.4; it was more confusing than useful, use `[]=`".} =
|
||||
## Puts a new ``(key, value)`` pair into ``t`` even if ``t[key]`` already exists.
|
||||
##
|
||||
## **This can introduce duplicate keys into the table!**
|
||||
|
|
@ -962,7 +963,8 @@ proc len*[A, B](t: TableRef[A, B]): int =
|
|||
|
||||
result = t.counter
|
||||
|
||||
proc add*[A, B](t: TableRef[A, B], key: A, val: B) =
|
||||
proc add*[A, B](t: TableRef[A, B], key: A, val: B) {.deprecated:
|
||||
"Deprecated since v1.4; it was more confusing than useful, use `[]=`".} =
|
||||
## Puts a new ``(key, value)`` pair into ``t`` even if ``t[key]`` already exists.
|
||||
##
|
||||
## **This can introduce duplicate keys into the table!**
|
||||
|
|
@ -1448,7 +1450,8 @@ proc len*[A, B](t: OrderedTable[A, B]): int {.inline.} =
|
|||
|
||||
result = t.counter
|
||||
|
||||
proc add*[A, B](t: var OrderedTable[A, B], key: A, val: B) =
|
||||
proc add*[A, B](t: var OrderedTable[A, B], key: A, val: B) {.deprecated:
|
||||
"Deprecated since v1.4; it was more confusing than useful, use `[]=`".} =
|
||||
## Puts a new ``(key, value)`` pair into ``t`` even if ``t[key]`` already exists.
|
||||
##
|
||||
## **This can introduce duplicate keys into the table!**
|
||||
|
|
@ -1935,7 +1938,8 @@ proc len*[A, B](t: OrderedTableRef[A, B]): int {.inline.} =
|
|||
|
||||
result = t.counter
|
||||
|
||||
proc add*[A, B](t: OrderedTableRef[A, B], key: A, val: B) =
|
||||
proc add*[A, B](t: OrderedTableRef[A, B], key: A, val: B) {.deprecated:
|
||||
"Deprecated since v1.4; it was more confusing than useful, use `[]=`".} =
|
||||
## Puts a new ``(key, value)`` pair into ``t`` even if ``t[key]`` already exists.
|
||||
##
|
||||
## **This can introduce duplicate keys into the table!**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue