From 06c8d4c68650bbc1fc158d90a44c4c17644c7889 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 8 Aug 2020 14:06:12 +0100 Subject: wrapup --- sort/shell.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sort/shell.go') diff --git a/sort/shell.go b/sort/shell.go index 4132ca6..4a8fded 100644 --- a/sort/shell.go +++ b/sort/shell.go @@ -17,12 +17,10 @@ func Shell(a ds.ArrayList) ds.ArrayList { for h >= 1 { for i := h; i < length; i++ { for j := i; j >= h; j -= h { - if a[j-h].Lower(a[j]) { + if a[j-h] < a[j] { break } - tmp := a[j] - a[j] = a[j-h] - a[j-h] = tmp + a.Swap(j, j-h) } } -- cgit v1.2.3