mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-07 21:43:33 +00:00
[bugfix] system.nim: make pop work with --newruntime
(cherry picked from commit 280193cc07)
This commit is contained in:
@@ -3071,8 +3071,12 @@ proc pop*[T](s: var seq[T]): T {.inline, noSideEffect.} =
|
||||
assert a == @[1, 3, 5]
|
||||
|
||||
var L = s.len-1
|
||||
result = s[L]
|
||||
setLen(s, L)
|
||||
when defined(nimV2):
|
||||
result = move s[L]
|
||||
shrink(s, L)
|
||||
else:
|
||||
result = s[L]
|
||||
setLen(s, L)
|
||||
|
||||
proc `==`*[T: tuple|object](x, y: T): bool =
|
||||
## Generic ``==`` operator for tuples that is lifted from the components.
|
||||
|
||||
Reference in New Issue
Block a user