mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
1
This commit is contained in:
parent
b7f0e2e6f3
commit
dec0c8cc47
@ -261,6 +261,14 @@ func SortAny[E any](es []E, fn func(a, b E) bool) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If true -> a, false -> b
|
||||||
|
func If[T any](isa bool, a, b T) T {
|
||||||
|
if isa {
|
||||||
|
return a
|
||||||
|
}
|
||||||
|
return b
|
||||||
|
}
|
||||||
|
|
||||||
type sortSlice[E any] struct {
|
type sortSlice[E any] struct {
|
||||||
ts []E
|
ts []E
|
||||||
fn func(a, b E) bool
|
fn func(a, b E) bool
|
||||||
|
Loading…
x
Reference in New Issue
Block a user