[bugfix] system.nim: make pop work with --newruntime
This commit is contained in:
parent
7e4748beee
commit
280193cc07
1 changed files with 6 additions and 2 deletions
|
|
@ -3071,8 +3071,12 @@ proc pop*[T](s: var seq[T]): T {.inline, noSideEffect.} =
|
||||||
assert a == @[1, 3, 5]
|
assert a == @[1, 3, 5]
|
||||||
|
|
||||||
var L = s.len-1
|
var L = s.len-1
|
||||||
result = s[L]
|
when defined(nimV2):
|
||||||
setLen(s, L)
|
result = move s[L]
|
||||||
|
shrink(s, L)
|
||||||
|
else:
|
||||||
|
result = s[L]
|
||||||
|
setLen(s, L)
|
||||||
|
|
||||||
proc `==`*[T: tuple|object](x, y: T): bool =
|
proc `==`*[T: tuple|object](x, y: T): bool =
|
||||||
## Generic ``==`` operator for tuples that is lifted from the components.
|
## Generic ``==`` operator for tuples that is lifted from the components.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue