summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e13b0c7)
Replaced by a two-valued `<-' read operator, which does exactly what we
want.
// 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) {
// 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.
}
// Answer whether the iterators return the same items in the same order.