Fix standardjs style errors

This commit is contained in:
Charlie Moore
2021-10-04 18:54:59 -04:00
parent 519f557899
commit 8e5743f8cb

View File

@ -15,7 +15,6 @@
* @return {number[]} An array of numbers sorted in increasing order.
*/
function cycleSort (list) {
let writes = 0
for (let cycleStart = 0; cycleStart < list.length; cycleStart++) {
let value = list[cycleStart]
let position = cycleStart
@ -30,7 +29,6 @@ function cycleSort (list) {
if (position === cycleStart) {
continue
}
while (value === list[position]) {
position++
}
@ -38,7 +36,6 @@ function cycleSort (list) {
const oldValue = list[position]
list[position] = value
value = oldValue
writes++
// rotate the rest
while (position !== cycleStart) {
@ -54,7 +51,6 @@ function cycleSort (list) {
const oldValueCycle = list[position]
list[position] = value
value = oldValueCycle
writes++
}
}
return list