small fixes and dependency updates

This commit is contained in:
ston1th 2023-08-25 02:06:53 +02:00
commit 96405e2521
238 changed files with 3599 additions and 3467 deletions

View file

@ -3,14 +3,15 @@
package chunk
import (
"golang.org/x/exp/slices"
"cmp"
"slices"
)
type Chunk [2]int64
type Chunks []Chunk
func (Chunks) Less(i, j Chunk) bool { return i[0] < j[0] }
func (Chunks) Comp(a, b Chunk) int { return cmp.Compare(a[0], b[0]) }
func (cs Chunks) Exists(off int64, n int, size int64) bool {
end := off + int64(n)
@ -42,7 +43,7 @@ func (cs *Chunks) merge() {
if len(c) < 2 {
return
}
slices.SortFunc(c, c.Less)
slices.SortFunc(c, c.Comp)
for i := 0; i < len(c); i++ {
if i+1 == len(c) {
break