Actions
Bug #17814
closedinconsistent Array.zip behavior
Bug #17814:
inconsistent Array.zip behavior
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
Description
When using Array.zip with an enumerator, it "eats" an additional element off the end of it. Enumerable.zip has the expected behavior of only taking as many elements as it needs to.
I've tested this on local ruby 2.7.2 and ruby 3.0.1 on carc.in.
Files
Updated by dzwdz (Kuba Prawdziwe-Nazwisko) over 5 years ago
Updated by mame (Yusuke Endoh) over 5 years ago
Good catch! https://github.com/ruby/ruby/pull/4389
Updated by mame (Yusuke Endoh) over 5 years ago
- Status changed from Open to Closed
Applied in changeset git|fb04c69418ceee696a114fe31279cf3a5ea16d30.
array.c (rb_ary_zip): take only as many as needed from an Enumerator (#4389)
[Bug #17814]
Actions