From 9ddd768cce291e5c562cde23baeeefb47aa79c86 Mon Sep 17 00:00:00 2001 From: Solitude Date: Mon, 10 Jul 2023 15:27:28 +0300 Subject: [PATCH] Rename `seq.add` parameter to be consistent with `refc` (#22244) --- lib/system/seqs_v2.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/system/seqs_v2.nim b/lib/system/seqs_v2.nim index 9aa4e71b98..efc2919fd4 100644 --- a/lib/system/seqs_v2.nim +++ b/lib/system/seqs_v2.nim @@ -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.}: