diff options
author | Alexander Neumann <alexander.neumann@picos-software.com> | 2019-04-17 10:12:18 +0200 |
---|---|---|
committer | Alexander Neumann <alexander.neumann@picos-software.com> | 2019-04-23 11:05:00 +0200 |
commit | 2248d0be12c98c49c09f6a2d13e6c4790ceffcb8 (patch) | |
tree | 0276b74a3632d49f5ee01401b9e621430d9ca082 | |
parent | ui: move orderedStringSet to util.go (diff) | |
download | wireguard-windows-2248d0be12c98c49c09f6a2d13e6c4790ceffcb8.tar.xz wireguard-windows-2248d0be12c98c49c09f6a2d13e6c4790ceffcb8.zip |
ui: simplify sorting of TunnelModel
Signed-off-by: Alexander Neumann <alexander.neumann@picos-software.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r-- | ui/tunnelsview.go | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/ui/tunnelsview.go b/ui/tunnelsview.go index f76b3319..1e70c5bc 100644 --- a/ui/tunnelsview.go +++ b/ui/tunnelsview.go @@ -38,17 +38,7 @@ func (t *TunnelModel) Value(row, col int) interface{} { func (t *TunnelModel) Sort(col int, order walk.SortOrder) error { sort.SliceStable(t.tunnels, func(i, j int) bool { - a, b := t.tunnels[i], t.tunnels[j] - - c := func(res bool) bool { - if order == walk.SortAscending { - return res - } - return !res - } - - // don't match col, always sort by name - return c(a.Name < b.Name) + return t.tunnels[i].Name < t.tunnels[j].Name }) return t.SorterBase.Sort(col, order) |