summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
authorapense <apense@users.noreply.github.com>2015-05-15 23:52:55 -0400
committerapense <apense@users.noreply.github.com>2015-05-15 23:52:55 -0400
commit7b26df50d75f64216997c71a304c7b413fc65dda (patch)
treee8705e809ddea69ddd6d77d9275a5ea873447b1f /lib/pure
parent1c0bbcff5a3d5176409245fdd685587d14ce64e3 (diff)
downloadNim-7b26df50d75f64216997c71a304c7b413fc65dda.tar.gz
Small sequence fix for algorithm.nim
Since #853 was fixed, this should work fine. The `result = @[]` was swapped to the same syntax, too.
Diffstat (limited to 'lib/pure')
-rw-r--r--lib/pure/algorithm.nim5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/pure/algorithm.nim b/lib/pure/algorithm.nim
index 6dfdff275..352b177e2 100644
--- a/lib/pure/algorithm.nim
+++ b/lib/pure/algorithm.nim
@@ -232,7 +232,7 @@ template sortedByIt*(seq1, op: expr): expr =
 proc product*[T](x: openArray[seq[T]]): seq[seq[T]] =
   ## produces the Cartesian product of the array. Warning: complexity
   ## may explode.
-  result = @[]
+  result = newSeq[seq[T]]()
   if x.len == 0:
     return
   if x.len == 1:
@@ -242,8 +242,7 @@ proc product*[T](x: openArray[seq[T]]): seq[seq[T]] =
     indexes = newSeq[int](x.len)
     initial = newSeq[int](x.len)
     index = 0
-  # replace with newSeq as soon as #853 is fixed
-  var next: seq[T] = @[]
+  var next = newSeq[T]()
   next.setLen(x.len)
   for i in 0..(x.len-1):
     if len(x[i]) == 0: return