From b8c45f87d6f7251701f95eb6b8ac1efd4255d298 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 8 Aug 2020 15:57:37 +0100 Subject: refactor --- sort/selection.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sort/selection.go') 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 -- cgit v1.2.3