* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7243069d29
commit
59b08c22b5
@ -1,3 +1,11 @@
|
|||||||
|
Mon Apr 21 16:06:47 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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@ruby-lang.org>
|
Mon Apr 21 11:00:27 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* compile.c (defined_expr): capture exception during defined?
|
* compile.c (defined_expr): capture exception during defined?
|
||||||
|
@ -37,7 +37,7 @@ proc_call(VALUE proc, VALUE args)
|
|||||||
|
|
||||||
struct enumerator {
|
struct enumerator {
|
||||||
VALUE obj;
|
VALUE obj;
|
||||||
VALUE meth;
|
ID meth;
|
||||||
VALUE proc;
|
VALUE proc;
|
||||||
VALUE args;
|
VALUE args;
|
||||||
rb_block_call_func *iter;
|
rb_block_call_func *iter;
|
||||||
@ -51,7 +51,6 @@ enumerator_mark(void *p)
|
|||||||
{
|
{
|
||||||
struct enumerator *ptr = p;
|
struct enumerator *ptr = p;
|
||||||
rb_gc_mark(ptr->obj);
|
rb_gc_mark(ptr->obj);
|
||||||
rb_gc_mark(ptr->meth);
|
|
||||||
rb_gc_mark(ptr->proc);
|
rb_gc_mark(ptr->proc);
|
||||||
rb_gc_mark(ptr->args);
|
rb_gc_mark(ptr->args);
|
||||||
rb_gc_mark(ptr->fib);
|
rb_gc_mark(ptr->fib);
|
||||||
@ -237,7 +236,7 @@ enumerator_init(VALUE enum_obj, VALUE obj, VALUE meth, int argc, VALUE *argv)
|
|||||||
struct enumerator *ptr = enumerator_ptr(enum_obj);
|
struct enumerator *ptr = enumerator_ptr(enum_obj);
|
||||||
|
|
||||||
ptr->obj = obj;
|
ptr->obj = obj;
|
||||||
ptr->meth = meth;
|
ptr->meth = rb_to_id(meth);
|
||||||
if (rb_block_given_p()) {
|
if (rb_block_given_p()) {
|
||||||
ptr->proc = rb_block_proc();
|
ptr->proc = rb_block_proc();
|
||||||
ptr->iter = enumerator_iter_i;
|
ptr->iter = enumerator_iter_i;
|
||||||
@ -334,7 +333,7 @@ enumerator_each(VALUE obj)
|
|||||||
argc = RARRAY_LEN(e->args);
|
argc = RARRAY_LEN(e->args);
|
||||||
argv = RARRAY_PTR(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
|
static VALUE
|
||||||
@ -367,7 +366,7 @@ enumerator_with_index(VALUE obj)
|
|||||||
argc = RARRAY_LEN(e->args);
|
argc = RARRAY_LEN(e->args);
|
||||||
argv = RARRAY_PTR(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);
|
enumerator_with_index_i, (VALUE)&memo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user