consensus/utils/count.go
DataHoarder 71c27726be
All checks were successful
continuous-integration/drone/push Build is passing
Introduce index.SortSideBlock and Difficulty Float64()
2024-04-03 18:50:47 +02:00

12 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
}