From 94a9551ffa696b0d6d3fd4e7c6aa8a2fc0c043c3 Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Sun, 18 Sep 2011 00:52:30 -0300 Subject: [PATCH] fixes #1699 --- examples/computer_science/selection_sort.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/computer_science/selection_sort.coffee b/examples/computer_science/selection_sort.coffee index ceaef517..a14f7f5a 100644 --- a/examples/computer_science/selection_sort.coffee +++ b/examples/computer_science/selection_sort.coffee @@ -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