qbtrade/pkg/fixedpoint/count.go

14 lines
194 B
Go
Raw Normal View History

2024-06-27 14:42:38 +00:00
package fixedpoint
type Counter func(a Value) bool
func Count(values []Value, counter Counter) int {
var c = 0
for _, value := range values {
if counter(value) {
c++
}
}
return c
}