ruby-changes:65826
From: Jeremy <ko1@a...>
Date: Sat, 10 Apr 2021 02:48:08 +0900 (JST)
Subject: [ruby-changes:65826] 9c31fb6114 (master): Fix documentation for Enumerator::Lazy#with_index
https://git.ruby-lang.org/ruby.git/commit/?id=9c31fb6114 From 9c31fb61148c28153ca084149b7e887abdfa408a Mon Sep 17 00:00:00 2001 From: Jeremy Evans <code@j...> Date: Fri, 9 Apr 2021 10:44:07 -0700 Subject: Fix documentation for Enumerator::Lazy#with_index If a block is given, it returns a lazy enumerator that will iterate over the block, it doesn't iterate over the block immediately. Fixes [Bug #17789] --- enumerator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/enumerator.c b/enumerator.c index a43434d..3ea4330 100644 --- a/enumerator.c +++ b/enumerator.c @@ -2709,7 +2709,8 @@ static const lazyenum_funcs lazy_with_index_funcs = { https://github.com/ruby/ruby/blob/trunk/enumerator.c#L2709 * lazy.with_index(offset = 0) {|(*args), idx| block } * lazy.with_index(offset = 0) * - * If a block is given, iterates the given block for each element + * If a block is given, returns a lazy enumerator that will + * iterate over the given block for each element * with an index, which starts from +offset+, and returns a * lazy enumerator that yields the same values (without the index). * -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/