From 369284d33c84e4325e46e745ccda0ec22265ff2f Mon Sep 17 00:00:00 2001 From: yugui Date: Tue, 20 Jan 2009 10:14:18 +0000 Subject: * reverts r21693. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@21697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ array.c | 4 +--- enum.c | 8 ++------ test/ruby/test_array.rb | 5 ----- test/ruby/test_enum.rb | 5 ----- 5 files changed, 7 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index d7692f62a..4b208e534 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Jan 20 19:12:18 2009 Yuki Sonoda (Yugui) + + * reverts r21693. + Tue Jan 20 18:49:59 2009 Yuki Sonoda (Yugui) * lib/rdoc/ri/path.rb: Gem::Enable was removed. diff --git a/array.c b/array.c index d88a9fcc3..3ba450cbe 100644 --- a/array.c +++ b/array.c @@ -2209,11 +2209,9 @@ take_i(VALUE val, VALUE *args, int argc, VALUE *argv) static VALUE take_items(VALUE obj, long n) { - VALUE result = to_ary(obj); + VALUE result = rb_ary_new2(n); VALUE args[2]; - if (!NIL_P(result)) return rb_ary_subseq(result, 0, n); - result = rb_ary_new2(n); args[0] = result; args[1] = (VALUE)n; rb_block_call(obj, rb_intern("each"), 0, 0, take_i, (VALUE)args); return result; diff --git a/enum.c b/enum.c index 8c4b5b93e..0bb8b6453 100644 --- a/enum.c +++ b/enum.c @@ -1558,17 +1558,13 @@ enum_zip(int argc, VALUE *argv, VALUE obj) ID conv; NODE *memo; VALUE result = Qnil; - VALUE args = rb_ary_new4(argc, argv); int allary = Qtrue; - argv = RARRAY_PTR(args); for (i=0; i