Media: Replace sort.Slice with slices.Sort for natural ordering (#4981)

Signed-off-by: findnature <cricis@aliyun.com>
This commit is contained in:
findnature
2025-06-23 22:38:55 +09:00
committed by GitHub
parent 47f9a509b1
commit b3bdd5d8ce

View File

@@ -1,6 +1,7 @@
package media
import (
"slices"
"sort"
"strings"
"unicode"
@@ -43,9 +44,7 @@ func Report(m fs.TypesExt, withDesc, withType, withExt bool) (rows [][]string, c
}
for f, ext := range m {
sort.Slice(ext, func(i, j int) bool {
return ext[i] < ext[j]
})
slices.Sort(ext)
v := make([]string, 0, 4)
v = append(v, strings.ToUpper(f.String()))