avoid block_given? in loop method for simplicity

This commit is contained in:
Yukihiro "Matz" Matsumoto
2015-01-31 10:44:58 +09:00
parent f01882a8e0
commit 02b54e5379
+2 -2
View File
@@ -24,8 +24,8 @@ module Kernel
# Calls the given block repetitively.
#
# ISO 15.3.1.3.29
def loop
return to_enum :loop unless block_given?
def loop(&block)
return to_enum :loop unless block
while(true)
yield