12 lines
165 B
Go
12 lines
165 B
Go
|
package main
|
||
|
|
||
|
|
||
|
func countRF(n int) func(yield func(int) bool) {
|
||
|
return func(yield func(int) bool) {
|
||
|
for i := range n {
|
||
|
if !yield(i) {
|
||
|
return
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|