From fbee8048f2ae9a53efdbc4872afc501bf6216376 Mon Sep 17 00:00:00 2001 From: Aaron Lasseigne Date: Thu, 6 Aug 2015 21:46:29 -0500 Subject: speed up code and avoid unnecessary MatchData objects --- activesupport/lib/active_support/inflector/inflections.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activesupport/lib/active_support/inflector/inflections.rb b/activesupport/lib/active_support/inflector/inflections.rb index 8ac1820776..3f4acf0745 100644 --- a/activesupport/lib/active_support/inflector/inflections.rb +++ b/activesupport/lib/active_support/inflector/inflections.rb @@ -49,7 +49,7 @@ module ActiveSupport end def uncountable?(str) - @regex_array.detect {|regex| regex.match(str) } + @regex_array.any? { |regex| str =~ regex } end private -- cgit v1.2.3