mirror of
https://github.com/photoprism/photoprism.git
synced 2026-01-23 02:24:24 +00:00
Media: Replace sort.Slice with slices.Sort for natural ordering (#4981)
Signed-off-by: findnature <cricis@aliyun.com>
This commit is contained in:
parent
47f9a509b1
commit
b3bdd5d8ce
1 changed files with 2 additions and 3 deletions
|
|
@ -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()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue