Mercurial > cgi-bin > hgweb.cgi > PassMan
diff src/main/kotlin/name/blackcap/passman/Generate.kt @ 8:698c4a3d758d
Some code clean-up.
author | David Barts <n5jrn@me.com> |
---|---|
date | Fri, 23 Sep 2022 20:59:52 -0700 |
parents | a6cfdffcaa94 |
children |
line wrap: on
line diff
--- a/src/main/kotlin/name/blackcap/passman/Generate.kt Tue Sep 20 21:54:32 2022 -0700 +++ b/src/main/kotlin/name/blackcap/passman/Generate.kt Fri Sep 23 20:59:52 2022 -0700 @@ -44,12 +44,12 @@ } /* scramble them */ - for (i in 0 until length) { - val j = randomizer.nextInt(length) - if (i != j) { - val temp = generated[i] - generated[i] = generated[j] - generated[j] = temp + for (j in 0 until length) { + val k = randomizer.nextInt(length) + if (j != k) { + val temp = generated[j] + generated[j] = generated[k] + generated[k] = temp } }