From 280193cc078c8777c6f4465eb141a441ed9d0638 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Thu, 20 Jun 2019 19:39:42 +0200 Subject: [bugfix] system.nim: make pop work with --newruntime --- lib/system.nim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib') 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. -- cgit 1.4.1-2-gfad0