Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The loop (particularly `range c`) keeps getting element out of `c` and assigning it to `n`. If it's "done", then `n` wouldn't be sent into `out`, but still gets read from the channel `c` constantly. In other words, it's the loop itself that makes sure everything sent into channel `c` is consumed.

If `break` is used, for loop is terminated once it's "done", hence nothing would be reading from channel `c`. The previous station in the pipeline would then block at sending operation.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: