Rename seq.add parameter to be consistent with refc (#22244)

This commit is contained in:
Solitude
2023-07-10 15:27:28 +03:00
committed by GitHub
parent ecc6ab7ee0
commit 9ddd768cce

View File

@@ -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.}: