mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Fix the return value of Integer#downto
called with a block
As the document states, it should return `self`, not `nil`.
Fix up of f4b313f733
.
This commit is contained in:
parent
70be2f4731
commit
0fe024d048
2 changed files with 8 additions and 7 deletions
|
@ -243,7 +243,7 @@ class Integer
|
|||
|
||||
# call-seq:
|
||||
# downto(limit) {|i| ... } -> self
|
||||
# downto(limit) -> enumerator
|
||||
# downto(limit) -> enumerator
|
||||
#
|
||||
# Calls the given block with each integer value from +self+ down to +limit+;
|
||||
# returns +self+:
|
||||
|
@ -268,6 +268,7 @@ class Integer
|
|||
yield from
|
||||
from = from.pred
|
||||
end
|
||||
self
|
||||
end
|
||||
|
||||
# call-seq:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue