summaryrefslogtreecommitdiff
path: root/sort/selection.go
diff options
context:
space:
mode:
authorPaul Buetow <pbuetow@mimecast.com>2020-08-08 15:57:37 +0100
committerPaul Buetow <pbuetow@mimecast.com>2020-08-08 15:57:37 +0100
commitb8c45f87d6f7251701f95eb6b8ac1efd4255d298 (patch)
tree6076a23ec57d75c57bd2a5556afbf9c94a32d23f /sort/selection.go
parentae7d31d6b6d735810ea27b788491d291754374aa (diff)
refactor
Diffstat (limited to 'sort/selection.go')
-rw-r--r--sort/selection.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/sort/selection.go b/sort/selection.go
index 798fa27..781292a 100644
--- a/sort/selection.go
+++ b/sort/selection.go
@@ -17,9 +17,7 @@ func Selection(a ds.ArrayList) ds.ArrayList {
if min == i {
continue
}
- tmp := a[i]
- a[i] = a[min]
- a[min] = tmp
+ a.Swap(i, min)
}
return a