mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Replace loop method with while true loop to gain performance.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user