Permalink
Browse files

Terminate loop if generated string longer than the last; ref #3489

  • Loading branch information...
matz committed Mar 10, 2017
1 parent 63dbed0 commit 4763312fb8f9c88c3fa7eb7f8710ad6fbd5ed1b4
Showing with 1 addition and 0 deletions.
  1. +1 −0 mrbgems/mruby-string-ext/mrblib/string.rb
@@ -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

0 comments on commit 4763312

Please sign in to comment.