diff options
author | Araq <rumpf_a@web.de> | 2015-03-27 02:14:27 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-03-27 02:14:27 +0100 |
commit | e80840c40af5c9108e9aed1573cf4f048a2757b8 (patch) | |
tree | 346fe321dccd550ddf3edf908c5bc9c8a99b8c0b /lib/pure | |
parent | 7720c0aafd61a446a6d36cc96c485c44d899dfd3 (diff) | |
download | Nim-e80840c40af5c9108e9aed1573cf4f048a2757b8.tar.gz |
preparations for dealing with the 'echo $foo' gotcha
Diffstat (limited to 'lib/pure')
-rw-r--r-- | lib/pure/algorithm.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/pure/algorithm.nim b/lib/pure/algorithm.nim index 08d224dfd..a1ab7be13 100644 --- a/lib/pure/algorithm.nim +++ b/lib/pure/algorithm.nim @@ -253,16 +253,16 @@ proc product*[T](x: openArray[seq[T]]): seq[seq[T]] = while true: while indexes[index] == -1: indexes[index] = initial[index] - index +=1 + index += 1 if index == x.len: return - indexes[index] -=1 + indexes[index] -= 1 for ni, i in indexes: next[ni] = x[ni][i] var res: seq[T] shallowCopy(res, next) result.add(res) index = 0 - indexes[index] -=1 + indexes[index] -= 1 proc nextPermutation*[T](x: var openarray[T]): bool {.discardable.} = ## Calculates the next lexicographic permutation, directly modifying ``x``. |