1
0
Fork 0

Merge branch v2.11 into v3.3

This commit is contained in:
kevinpollet 2025-02-24 15:57:50 +01:00
commit 32ea014d07
No known key found for this signature in database
GPG key ID: 0C9A5DDD1B292453
13 changed files with 351 additions and 215 deletions

View file

@ -1,10 +1,9 @@
package api
import (
"cmp"
"net/url"
"sort"
"golang.org/x/exp/constraints"
)
const (
@ -357,7 +356,7 @@ func sortByName[T orderedWithName](direction string, results []T) {
})
}
func sortByFunc[T orderedWithName, U constraints.Ordered](direction string, results []T, fn func(int) U) {
func sortByFunc[T orderedWithName, U cmp.Ordered](direction string, results []T, fn func(int) U) {
// Ascending
if direction == ascendantSorting {
sort.Slice(results, func(i, j int) bool {