Documentation comment for OrderBy which I missed out

This commit is contained in:
Andy Long 2022-09-03 19:31:41 +01:00
parent a197836c1d
commit a72da82172

View file

@ -1,5 +1,8 @@
package underscore
// Orders a slice by a field value within a struct, the predicate allow you
// to pick the fields you want to orderBy. Use > for ASC or < for DESC
// func (left Person, right Person) bool { return person.Age > person.Age }
func OrderBy[T any](list []T, predicate func(T, T) bool) []T {
swaps := true
var tmp T