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

* lib/mathn.rb (Prime#each): returns an enumerator if no block

given. [ruby-dev:32815]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kazu 2008-01-09 13:10:31 +00:00
parent ad4fb57a3a
commit cbf7c9adde
2 changed files with 6 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Wed Jan 9 22:04:17 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* lib/mathn.rb (Prime#each): returns an enumerator if no block
given. [ruby-dev:32815]
Wed Jan 9 22:03:26 2008 NARUSE, Yui <naruse@ruby-lang.org>
* encoding.c (rb_enc_replicate): replica of dummy is a dummy.

View file

@ -101,6 +101,7 @@ class Prime
alias next succ
def each
return to_enum(:each) unless block_given?
loop do
yield succ
end