diff --git a/enumerator.c b/enumerator.c index 566f218b57..662056d5a5 100644 --- a/enumerator.c +++ b/enumerator.c @@ -1259,6 +1259,12 @@ enum_size(VALUE self) return (r == Qundef) ? Qnil : r; } +static VALUE +lazyenum_size(VALUE self, VALUE args, VALUE eobj) +{ + return enum_size(self); +} + static VALUE lazy_size(VALUE self) { @@ -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;