Added strings.ToLower() to all stable sorts to ensure intuitive ordering

This commit is contained in:
Seednode 2023-06-20 09:02:13 -05:00
parent 780bed087d
commit 7ca86c19fd
2 changed files with 3 additions and 3 deletions

View File

@ -11,7 +11,7 @@ import (
) )
const ( const (
Version string = "0.52.1" Version string = "0.52.2"
) )
var ( var (

View File

@ -258,7 +258,7 @@ func (s *ServeStats) ListImages() ([]byte, error) {
stats := s.toExported() stats := s.toExported()
sort.SliceStable(stats.List, func(p, q int) bool { sort.SliceStable(stats.List, func(p, q int) bool {
return stats.List[p] < stats.List[q] return strings.ToLower(stats.List[p]) < strings.ToLower(stats.List[q])
}) })
a := make([]timesServed, len(stats.List)) a := make([]timesServed, len(stats.List))
@ -718,7 +718,7 @@ func serveDebugJson(args []string, index *Index) httprouter.Handle {
indexDump := index.Index() indexDump := index.Index()
sort.SliceStable(indexDump, func(p, q int) bool { sort.SliceStable(indexDump, func(p, q int) bool {
return indexDump[p] < indexDump[q] return strings.ToLower(indexDump[p]) < strings.ToLower(indexDump[q])
}) })
response, err := json.MarshalIndent(indexDump, "", " ") response, err := json.MarshalIndent(indexDump, "", " ")