Replace loop method with while true loop to gain performance.

This commit is contained in:
Yukihiro "Matz" Matsumoto
2019-09-13 09:21:16 +09:00
parent 5489fae8f2
commit 2fa4a55e80
@@ -587,8 +587,12 @@ class Enumerator
val = init
y.yield(val)
end
loop do
y.yield(val = block.call(val))
begin
while true
y.yield(val = block.call(val))
end
rescue StopIteration
# do nothing
end
end
end