diff options
author | Aaron Lasseigne <aaron.lasseigne@gmail.com> | 2015-08-06 21:46:29 -0500 |
---|---|---|
committer | Aaron Lasseigne <aaron.lasseigne@gmail.com> | 2015-08-06 21:46:29 -0500 |
commit | fbee8048f2ae9a53efdbc4872afc501bf6216376 (patch) | |
tree | be23f64aa48cc0045ee3bbc4433befd6afb04302 /activesupport/lib/active_support/inflector | |
parent | 07b2ff03d04656faccc68c83541b06e318a36ed7 (diff) | |
download | rails-fbee8048f2ae9a53efdbc4872afc501bf6216376.tar.gz rails-fbee8048f2ae9a53efdbc4872afc501bf6216376.tar.bz2 rails-fbee8048f2ae9a53efdbc4872afc501bf6216376.zip |
speed up code and avoid unnecessary MatchData objects
Diffstat (limited to 'activesupport/lib/active_support/inflector')
-rw-r--r-- | activesupport/lib/active_support/inflector/inflections.rb | 2 |
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 |