提交 261b2754 编写于 作者: R Richard Schneeman

Merge pull request #21155 from AaronLasseigne/fewer_objects

Speed up code and avoid unnecessary MatchData objects
......@@ -49,7 +49,7 @@ def add(words)
end
def uncountable?(str)
@regex_array.detect {|regex| regex.match(str) }
@regex_array.any? { |regex| str =~ regex }
end
private
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册