aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Schneeman <richard.schneeman@gmail.com>2015-08-06 22:29:13 -0500
committerRichard Schneeman <richard.schneeman@gmail.com>2015-08-06 22:29:13 -0500
commit261b275494fa2d144528f3f477463ae1cb8e00d7 (patch)
tree15ebd0fe8f433cef47b9a136cad4dc250aa29bac
parent3fb5cd4d407840ce0a40e4fc82e07a33768a00be (diff)
parentfbee8048f2ae9a53efdbc4872afc501bf6216376 (diff)
downloadrails-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
-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