From 185e2676afec07e07dc2cbe09db0c8a1965b50af Mon Sep 17 00:00:00 2001 From: knu Date: Tue, 22 Apr 2008 10:39:19 +0000 Subject: [PATCH] * enumerator.c (enumerator_initialize): Remove an undocumented feature (passing a block to the constructor) that's broken. This is not what I intended. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ enumerator.c | 10 +--------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index edda653c66..5119ab0b01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Apr 22 19:35:03 2008 Akinori MUSHA + + * enumerator.c (enumerator_initialize): Remove an undocumented + feature (passing a block to the constructor) that's broken. + This is not what I intended. + Tue Apr 22 17:49:46 2008 Yukihiro Matsumoto * sprintf.c (rb_f_sprintf): should protect temporary string from diff --git a/enumerator.c b/enumerator.c index 4a5e88f6ac..2cb3ca01e3 100644 --- a/enumerator.c +++ b/enumerator.c @@ -51,7 +51,6 @@ enumerator_mark(p) { struct enumerator *ptr = p; rb_gc_mark(ptr->obj); - rb_gc_mark(ptr->proc); rb_gc_mark(ptr->args); } @@ -258,13 +257,7 @@ enumerator_init(enum_obj, obj, meth, argc, argv) ptr->obj = obj; ptr->meth = rb_to_id(meth); - if (rb_block_given_p()) { - ptr->proc = rb_block_proc(); - ptr->iter = enumerator_iter_i; - } - else { - ptr->iter = enumerator_each_i; - } + ptr->iter = enumerator_each_i; if (argc) ptr->args = rb_ary_new4(argc, argv); return enum_obj; @@ -316,7 +309,6 @@ enumerator_init_copy(obj, orig) ptr1->obj = ptr0->obj; ptr1->meth = ptr0->meth; - ptr1->proc = ptr0->proc; ptr1->iter = ptr0->iter; ptr1->args = ptr0->args;