summary refs log tree commit diff stats
path: root/lib/pure/collections/sequtils.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2020-04-01 14:34:24 +0200
committerAndreas Rumpf <rumpf_a@web.de>2020-04-01 19:38:44 +0200
commit484548c784f69cadc1f6480a24e99183a0e6a930 (patch)
treed79ee14aa8cc6ce07690764b6204a81529a6c0d3 /lib/pure/collections/sequtils.nim
parent66f18037b3d10dca7d32675651ec969217036992 (diff)
downloadNim-484548c784f69cadc1f6480a24e99183a0e6a930.tar.gz
revert stdlib changes which are not required anymore
Diffstat (limited to 'lib/pure/collections/sequtils.nim')
-rw-r--r--lib/pure/collections/sequtils.nim5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/pure/collections/sequtils.nim b/lib/pure/collections/sequtils.nim
index 893f31389..e32c784c6 100644
--- a/lib/pure/collections/sequtils.nim
+++ b/lib/pure/collections/sequtils.nim
@@ -371,8 +371,9 @@ proc map*[T, S](s: openArray[T], op: proc (x: T): S {.closure.}):
       b = map(a, proc(x: int): string = $x)
     assert b == @["1", "2", "3", "4"]
 
-  result = newSeqOfCap[S](s.len)
-  for elem in s: result.add op(elem)
+  newSeq(result, s.len)
+  for i in 0 ..< s.len:
+    result[i] = op(s[i])
 
 proc apply*[T](s: var openArray[T], op: proc (x: var T) {.closure.})
                                                               {.inline.} =