Move wasMoved out of =destroy
This commit is contained in:
parent
3e52136f26
commit
4a1128d16c
5 changed files with 9 additions and 19 deletions
|
|
@ -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.}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue