Small sequence fix for algorithm.nim
Since #853 was fixed, this should work fine. The `result = @[]` was swapped to the same syntax, too.
This commit is contained in:
parent
1c0bbcff5a
commit
7b26df50d7
1 changed files with 2 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue