~sircmpwn/aerc

dirlist: remove not needed sort function v1 PROPOSED

Reto Brunner: 1
 dirlist: remove not needed sort function

 1 files changed, 1 insertions(+), 2 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/aerc/patches/9628/mbox | git am -3
Learn more about email & git

[PATCH] dirlist: remove not needed sort function Export this patch

The docs of strings.Compare state:

> Compare is included only for symmetry with package bytes. It is usually
> clearer and always faster to use the built-in string comparison operators
> ==, <, >, and so on.

So let's do that.
---
 widgets/dirlist.go | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/widgets/dirlist.go b/widgets/dirlist.go
index c0c8917..edc84c6 100644
--- a/widgets/dirlist.go
+++ b/widgets/dirlist.go
@@ -5,7 +5,6 @@ import (
	"log"
	"regexp"
	"sort"
	"strings"

	"github.com/gdamore/tcell"
	"github.com/mattn/go-runewidth"
@@ -316,7 +315,7 @@ func (dirlist *DirectoryList) sortDirsByFoldersSortConfig() {
		if jInFoldersSort >= 0 {
			return false
		}
		return strings.Compare(dirlist.dirs[i], dirlist.dirs[j]) == -1
		return dirlist.dirs[i] < dirlist.dirs[j]
	})
}

-- 
2.25.0
View this thread in the archives