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

This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-03-10 10:38:28 +09:00
parent 63dbed0094
commit 4763312fb8
@@ -345,6 +345,7 @@ class String
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