]> git.lizzy.rs Git - rust.git/commit
Make Zip iterator short-circuit
authorKevin Ballard <kevin@sb.org>
Sat, 3 Aug 2013 22:41:29 +0000 (15:41 -0700)
committerKevin Ballard <kevin@sb.org>
Fri, 30 Aug 2013 05:49:26 +0000 (22:49 -0700)
commita3d18bc95b1639cf3cb967165f7104e2c79893f5
treebaa14af3e79204f372cc692e79a0ed8c3e6ee5eb
parentfb0b388804ec6b4535e73a890feda7372182486f
Make Zip iterator short-circuit

Python's zip() short-circuits by not even querying its right-hand
iterator if the left-hand one is done. Match that behavior here by not
calling .next() on the right iterator if the left one returns None.
src/libstd/iterator.rs