1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* array.c (rb_ary_count): Override Enumerable#count for better

performance.
  (rb_ary_nitems): Undo the backport.  Use #count {} instead.

* enumerator.c (enumerator_iter_i): Remove an unused function.
  (enumerator_with_index, enumerator_each): Remove unused
  variables.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
knu 2008-05-14 10:26:48 +00:00
parent e9d69ca0ce
commit d007e7d20f
5 changed files with 62 additions and 33 deletions

View file

@ -72,16 +72,6 @@ enumerator_ptr(obj)
return ptr;
}
static VALUE enumerator_iter_i _((VALUE, VALUE));
static VALUE
enumerator_iter_i(i, enum_obj)
VALUE i;
VALUE enum_obj;
{
struct enumerator *e = (struct enumerator *)enum_obj;
return rb_yield(proc_call(e->proc, i));
}
/*
* call-seq:
* obj.to_enum(method = :each, *args)
@ -339,7 +329,6 @@ enumerator_each(obj)
struct enumerator *e;
int argc = 0;
VALUE *argv = 0;
VALUE method;
if (!rb_block_given_p()) return obj;
e = enumerator_ptr(obj);
@ -377,7 +366,6 @@ enumerator_with_index(obj)
VALUE memo = 0;
int argc = 0;
VALUE *argv = 0;
VALUE method;
RETURN_ENUMERATOR(obj, 0, 0);
if (e->args) {