ruby-changes:4627
From: ko1@a...
Date: Mon, 21 Apr 2008 16:07:54 +0900 (JST)
Subject: [ruby-changes:4627] matz - Ruby:r16121 (trunk): * enumerator.c (enumerator_init): preserve the method name in ID.
matz 2008-04-21 16:07:39 +0900 (Mon, 21 Apr 2008)
New Revision: 16121
Modified files:
trunk/ChangeLog
trunk/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/trunk/ChangeLog?r1=16121&r2=16120&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/enumerator.c?r1=16121&r2=16120&diff_format=u
Index: ChangeLog
===================================================================
--- ChangeLog (revision 16120)
+++ ChangeLog (revision 16121)
@@ -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 11:00:27 2008 Yukihiro Matsumoto <matz@r...>
* compile.c (defined_expr): capture exception during defined?
Index: enumerator.c
===================================================================
--- enumerator.c (revision 16120)
+++ enumerator.c (revision 16121)
@@ -37,7 +37,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);
rb_gc_mark(ptr->fib);
@@ -237,7 +236,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;
@@ -334,7 +333,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
@@ -367,7 +366,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/