aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorAaron Lasseigne <aaron.lasseigne@gmail.com>2015-08-06 21:46:29 -0500
committerAaron Lasseigne <aaron.lasseigne@gmail.com>2015-08-06 21:46:29 -0500
commitfbee8048f2ae9a53efdbc4872afc501bf6216376 (patch)
treebe23f64aa48cc0045ee3bbc4433befd6afb04302 /activesupport
parent07b2ff03d04656faccc68c83541b06e318a36ed7 (diff)
downloadrails-fbee8048f2ae9a53efdbc4872afc501bf6216376.tar.gz
rails-fbee8048f2ae9a53efdbc4872afc501bf6216376.tar.bz2
rails-fbee8048f2ae9a53efdbc4872afc501bf6216376.zip
speed up code and avoid unnecessary MatchData objects
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/inflector/inflections.rb2
1 files changed, 1 insertions, 1 deletions
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