chiark / gitweb /
go-fringe.go: Language change: `closed' function on channels has gone.
[fringe] / go-fringe.go
index 70e23b56da3011da7be54fd1194afefa2b74157c..d79760ede6e71dde7e399d9369b0b68399ccdaf0 100644 (file)
@@ -52,9 +52,8 @@ func MakeIterator(it Iterable) Iterator {
 // Returns the next item from an iterator IT.  If there is indeed an item
 // available, return it and true; otherwise return nil and false.
 func (it Iterator) Next() (any, bool) {
-       item := <-it;
-       if closed(it) { return nil, false; }
-       return item, true;
+       item, anyp := <-it;
+       return item, anyp;
 }
 
 // Answer whether the iterators return the same items in the same order.