diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2019-06-20 19:39:42 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-06-20 19:39:42 +0200 |
commit | 280193cc078c8777c6f4465eb141a441ed9d0638 (patch) | |
tree | c9f0c2a358afc0036fdf5d04d8812ecfeaacaed0 /lib | |
parent | 7e4748beeee3b7fb89801f6fe1e9693423e36f86 (diff) | |
download | Nim-280193cc078c8777c6f4465eb141a441ed9d0638.tar.gz |
[bugfix] system.nim: make pop work with --newruntime
Diffstat (limited to 'lib')
-rw-r--r-- | lib/system.nim | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/system.nim b/lib/system.nim index 631124a0f..11c91533c 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -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. |