dirlist: remove not needed sort function

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.
This commit is contained in:
Reto Brunner 2020-01-26 12:03:21 +01:00 committed by Drew DeVault
parent e78b7b85e4
commit 2a3d120d6f
1 changed files with 1 additions and 2 deletions

View File

@ -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]
})
}