Skip to content

Commit

Permalink
Terminate loop if generated string longer than the last; ref #3489
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Mar 10, 2017
1 parent 63dbed0 commit 4763312
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mrbgems/mruby-string-ext/mrblib/string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ def upto(other_str, excl=false, &block)
return self if !excl && str == other_str
str = str.succ
return self if excl && str == other_str
return self if str.size > other_str.size
end
end

Expand Down

0 comments on commit 4763312

Please sign in to comment.