simplified loop over channel inputs

This commit is contained in:
Philipp Mieden 2019-05-21 09:19:25 +02:00
parent 8f7c23ff4a
commit 42adb6a25a

View File

@ -24,12 +24,9 @@ func newStats() *stats {
chanCount: make(chan int),
}
go func() {
for {
select {
case <-s.chanCount:
s.requests++
s.chanCount <- 1
}
for _ = range s.chanCount {
s.requests++
s.chanCount <- 1
}
}()
return s