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), chanCount: make(chan int),
} }
go func() { go func() {
for { for _ = range s.chanCount {
select { s.requests++
case <-s.chanCount: s.chanCount <- 1
s.requests++
s.chanCount <- 1
}
} }
}() }()
return s return s