diff options
Diffstat (limited to 'sort/shell.go')
| -rw-r--r-- | sort/shell.go | 6 |
1 files changed, 2 insertions, 4 deletions
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) } } |
