summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-28 04:26:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-28 04:26:21 +0000
commitda0c4e5e1166db66f254194fe8f2dcff55d904ef (patch)
tree560a83cc7cff08f9726e4342d07bfbf16cda1caa
parentb83b33eef025546d43f7e05895c06629e37edd34 (diff)
enumerator.c: lazyenum_size
* enumerator.c (lazyenum_size): adjust arguments. * enumerator.c (enumerable_lazy): use lazyenum_size() instead of enum_size(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--enumerator.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/enumerator.c b/enumerator.c
index 566f218..662056d 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -1260,6 +1260,12 @@ enum_size(VALUE self)
}
static VALUE
+lazyenum_size(VALUE self, VALUE args, VALUE eobj)
+{
+ return enum_size(self);
+}
+
+static VALUE
lazy_size(VALUE self)
{
return enum_size(rb_ivar_get(self, id_receiver));
@@ -1405,7 +1411,7 @@ lazy_set_method(VALUE lazy, VALUE args, rb_enumerator_size_func *size_fn)
static VALUE
enumerable_lazy(VALUE obj)
{
- VALUE result = lazy_to_enum_i(obj, sym_each, 0, 0, enum_size);
+ VALUE result = lazy_to_enum_i(obj, sym_each, 0, 0, lazyenum_size);
/* Qfalse indicates that the Enumerator::Lazy has no method name */
rb_ivar_set(result, id_method, Qfalse);
return result;