mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-22 00:08:04 +02:00
Port calls to slices.Sort functions since they now need a cmp() function rather than a less() function
Also rename os.SEEK_* to io.Seek* as the former has been deprecated
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"kitty/tools/utils"
|
||||
@@ -42,8 +43,8 @@ func TestDiffCollectWalk(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if diff := cmp.Diff(
|
||||
utils.Sort(expected_names.AsSlice(), func(a, b string) bool { return a < b }),
|
||||
utils.Sort(names.AsSlice(), func(a, b string) bool { return a < b }),
|
||||
utils.Sort(expected_names.AsSlice(), strings.Compare),
|
||||
utils.Sort(names.AsSlice(), strings.Compare),
|
||||
); diff != "" {
|
||||
t.Fatal(diff)
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ func (self *Search) search(logical_lines *LogicalLines) {
|
||||
}
|
||||
})
|
||||
for _, spans := range self.matches {
|
||||
slices.SortFunc(spans, func(a, b Span) bool { return a.start < b.start })
|
||||
slices.SortFunc(spans, func(a, b Span) int { return a.start - b.start })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user