Permalink
Browse files

Forgot to close the channel when Iter() finishes.

  • Loading branch information...
1 parent da52844 commit c308d99439e0c1bd2765bd62dd68e78c2cf596c0 @phf committed Apr 15, 2010
Showing with 3 additions and 0 deletions.
  1. +1 −0 bitset.go
  2. +1 −0 hashset.go
  3. +1 −0 sparseset.go
View
@@ -45,6 +45,7 @@ func (self *Bitset) iterate(c chan<- int) {
value >>= 1
}
}
+ close(c)
}
func (self *Bitset) Iter() <-chan int {
View
@@ -24,6 +24,7 @@ func (self *Hash) iterate(c chan<- int) {
for k, _ := range self.data {
c <- k
}
+ close(c)
}
func (self *Hash) Iter() <-chan int {
View
@@ -39,6 +39,7 @@ func (self *Sparse) iterate(c chan<- int) {
for i := 0; i < self.next; i++ {
c <- self.dense[i]
}
+ close(c)
}
func (self *Sparse) Iter() <-chan int {

0 comments on commit c308d99

Please sign in to comment.