Skip to content

Commit 796ed38

Browse files
committed
By make `s` SSA
1 parent 1e2479b commit 796ed38

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/permutations.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ end
3636
start(p::Permutations) = [1:length(p.a);]
3737
next(p::Permutations, s) = nextpermutation(p.a, p.t ,s)
3838

39-
function nextpermutation(m, t, s)
40-
perm = [m[s[i]] for i in 1:t]
41-
n = length(s)
39+
function nextpermutation(m, t, state)
40+
perm = [m[state[i]] for i in 1:t]
41+
n = length(state)
4242
if t <= 0
4343
return(perm, [n+1])
4444
end
45-
s = copy(s)
45+
s = copy(state)
4646
if t < n
4747
j = t + 1
4848
while j <= n && s[t] >= s[j]; j+=1; end

0 commit comments

Comments
 (0)