mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
Rename seq.add parameter to be consistent with refc (#22244)
This commit is contained in:
@@ -102,7 +102,7 @@ proc grow*[T](x: var seq[T]; newLen: Natural; value: T) =
|
||||
for i in oldLen .. newLen-1:
|
||||
xu.p.data[i] = value
|
||||
|
||||
proc add*[T](x: var seq[T]; value: sink T) {.magic: "AppendSeqElem", noSideEffect, nodestroy.} =
|
||||
proc add*[T](x: var seq[T]; y: sink T) {.magic: "AppendSeqElem", noSideEffect, nodestroy.} =
|
||||
## Generic proc for adding a data item `y` to a container `x`.
|
||||
##
|
||||
## For containers that have an order, `add` means *append*. New generic
|
||||
@@ -119,7 +119,7 @@ proc add*[T](x: var seq[T]; value: sink T) {.magic: "AppendSeqElem", noSideEffec
|
||||
# copyMem(). This is fine as know by construction that
|
||||
# in `xu.p.data[oldLen]` there is nothing to destroy.
|
||||
# We also save the `wasMoved + destroy` pair for the sink parameter.
|
||||
xu.p.data[oldLen] = value
|
||||
xu.p.data[oldLen] = y
|
||||
|
||||
proc setLen[T](s: var seq[T], newlen: Natural) =
|
||||
{.noSideEffect.}:
|
||||
|
||||
Reference in New Issue
Block a user