ruby-changes:4632
From: ko1@a...
Date: Mon, 21 Apr 2008 18:41:58 +0900 (JST)
Subject: [ruby-changes:4632] knu - Ruby:r16126 (ruby_1_8): * enumerator.c (enumerator_init): preserve the method name in ID.
knu 2008-04-21 18:41:40 +0900 (Mon, 21 Apr 2008) New Revision: 16126 Modified files: branches/ruby_1_8/ChangeLog branches/ruby_1_8/enumerator.c Log: * enumerator.c (enumerator_init): preserve the method name in ID. * enumerator.c (enumerator_each): need not to call rb_to_id(). * enumerator.c (enumerator_with_index): ditto. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ChangeLog?r1=16126&r2=16125&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/enumerator.c?r1=16126&r2=16125&diff_format=u Index: ruby_1_8/ChangeLog =================================================================== --- ruby_1_8/ChangeLog (revision 16125) +++ ruby_1_8/ChangeLog (revision 16126) @@ -1,3 +1,11 @@ +Mon Apr 21 16:06:47 2008 Yukihiro Matsumoto <matz@r...> + + * enumerator.c (enumerator_init): preserve the method name in ID. + + * enumerator.c (enumerator_each): need not to call rb_to_id(). + + * enumerator.c (enumerator_with_index): ditto. + Mon Apr 21 17:19:52 2008 Akinori MUSHA <knu@i...> * eval.c (rb_f_method_name): New gloval function: __method__; Index: ruby_1_8/enumerator.c =================================================================== --- ruby_1_8/enumerator.c (revision 16125) +++ ruby_1_8/enumerator.c (revision 16126) @@ -38,7 +38,7 @@ struct enumerator { VALUE obj; - VALUE meth; + ID meth; VALUE proc; VALUE args; rb_block_call_func *iter; @@ -51,7 +51,6 @@ { struct enumerator *ptr = p; rb_gc_mark(ptr->obj); - rb_gc_mark(ptr->meth); rb_gc_mark(ptr->proc); rb_gc_mark(ptr->args); } @@ -258,7 +257,7 @@ struct enumerator *ptr = enumerator_ptr(enum_obj); ptr->obj = obj; - ptr->meth = meth; + ptr->meth = rb_to_id(meth); if (rb_block_given_p()) { ptr->proc = rb_block_proc(); ptr->iter = enumerator_iter_i; @@ -357,7 +356,7 @@ argc = RARRAY_LEN(e->args); argv = RARRAY_PTR(e->args); } - return rb_block_call(e->obj, rb_to_id(e->meth), argc, argv, e->iter, (VALUE)e); + return rb_block_call(e->obj, e->meth, argc, argv, e->iter, (VALUE)e); } static VALUE @@ -393,7 +392,7 @@ argc = RARRAY_LEN(e->args); argv = RARRAY_PTR(e->args); } - return rb_block_call(e->obj, rb_to_id(e->meth), argc, argv, + return rb_block_call(e->obj, e->meth, argc, argv, enumerator_with_index_i, (VALUE)&memo); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/