Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6RC1
-
Fix Version/s: JRuby 1.6RC1
-
Component/s: Core Classes/Modules
-
Labels:None
-
Environment:Debian GNU/Linux 6.0 (squeeze), OpenJDK 6, Intel Core i5
-
Testcase included:yes
-
Number of attachments :
Description
require 'test/minirunit'
test_equal [0, 1], [0, 1, 2, 3].each_slice(2).first
test_equal [[0, 1], [2, 3]], [0, 1, 2, 3].each_slice(2).to_a
test_equal [[0, 1], [2, 3]], [0, 1, 2, 3].each_slice(2).map
Thanks for the report, Nicholas.
Bisecting shows that this is a regression introduced with this commit:
7732e5eb43a037615caf4ed5814551f66d497930 is the first bad commit commit 7732e5eb43a037615caf4ed5814551f66d497930 Author: Charles Oliver Nutter <headius@headius.com> Date: Mon Dec 6 00:36:15 2010 -0600 Tweaks to support some lighter-weight versions of newer Enumerable methods. * Make all "CallBlock" blocks in Enumerable pass along a proper arity, so we know whether they might want a real array or specific-arity args * Improve Array#each_splice by avoiding intermediate blocks (always) and extra array creations (for specific-arity > 1) to reduce overhead. 30-50% faster. :040000 040000 055a544312d844dbe5596705e1ac2be440180b78 ea9a65add4d82e1ce348e24b67d5fe20bc79597e M srcWe'll also have to take a look at RubySpec, since we missed this.