DataHoarder
71c27726be
All checks were successful
continuous-integration/drone/push Build is passing
11 lines
151 B
Go
11 lines
151 B
Go
package utils
|
|
|
|
func SliceCount[S ~[]E, E any](s S, f func(E) bool) (count int) {
|
|
for i := range s {
|
|
if f(s[i]) {
|
|
count++
|
|
}
|
|
}
|
|
|
|
return count
|
|
}
|