mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
fixes #1699
This commit is contained in:
parent
4419f7ca0f
commit
94a9551ffa
1 changed files with 1 additions and 1 deletions
|
|
@ -9,7 +9,7 @@ selection_sort = (list) ->
|
|||
min = i
|
||||
|
||||
# Check the rest of the array to see if anything is smaller.
|
||||
min = j if list[j] < list[min] for j in [i + 1...len]
|
||||
min = k for v, k in list[i+1...] when v < list[min]
|
||||
|
||||
# Swap if a smaller item has been found.
|
||||
[list[i], list[min]] = [list[min], list[i]] if i isnt min
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue