diff options
author | Richard Schneeman <richard.schneeman@gmail.com> | 2015-08-06 22:29:13 -0500 |
---|---|---|
committer | Richard Schneeman <richard.schneeman@gmail.com> | 2015-08-06 22:29:13 -0500 |
commit | 261b275494fa2d144528f3f477463ae1cb8e00d7 (patch) | |
tree | 15ebd0fe8f433cef47b9a136cad4dc250aa29bac /activesupport/lib/active_support/inflector | |
parent | 3fb5cd4d407840ce0a40e4fc82e07a33768a00be (diff) | |
parent | fbee8048f2ae9a53efdbc4872afc501bf6216376 (diff) | |
download | rails-261b275494fa2d144528f3f477463ae1cb8e00d7.tar.gz rails-261b275494fa2d144528f3f477463ae1cb8e00d7.tar.bz2 rails-261b275494fa2d144528f3f477463ae1cb8e00d7.zip |
Merge pull request #21155 from AaronLasseigne/fewer_objects
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 |