mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-29 18:53:58 +00:00
Move wasMoved out of =destroy
This commit is contained in:
@@ -73,11 +73,10 @@ proc shrink*[T](x: var seq[T]; newLen: Natural) =
|
||||
when nimvm:
|
||||
setLen(x, newLen)
|
||||
else:
|
||||
mixin `=destroy`
|
||||
#sysAssert newLen <= x.len, "invalid newLen parameter for 'shrink'"
|
||||
when not supportsCopyMem(T):
|
||||
for i in countdown(x.len - 1, newLen):
|
||||
`=destroy`(x[i])
|
||||
reset x[i]
|
||||
# XXX This is wrong for const seqs that were moved into 'x'!
|
||||
cast[ptr NimSeqV2[T]](addr x).len = newLen
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ when defined(nimv2):
|
||||
proc `=destroy`(a: var WideCStringObj) =
|
||||
if a.data != nil:
|
||||
deallocShared(a.data)
|
||||
a.data = nil
|
||||
|
||||
proc `=`(a: var WideCStringObj; b: WideCStringObj) {.error.}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user