Replace `loop` method with `while true` loop to gain performance.
@@ -587,9 +587,13 @@ class Enumerator
val = init
y.yield(val)
end
- loop do
+ begin
+ while true
y.yield(val = block.call(val))
end
+ rescue StopIteration
+ # do nothing
+ end
end
end
end
