diff options
author | schneems <richard.schneeman@gmail.com> | 2015-08-07 11:16:32 -0500 |
---|---|---|
committer | schneems <richard.schneeman@gmail.com> | 2015-08-07 11:16:32 -0500 |
commit | 752432e82f3032e96ba609b65437cd8e8b8d3939 (patch) | |
tree | 5771fdf528d70b7da1e20e39efff5208456c973e /activesupport/lib/active_support/inflector | |
parent | 9b7ecf0d6d284825a2e1ce57c0074b8f945a791f (diff) | |
download | rails-752432e82f3032e96ba609b65437cd8e8b8d3939.tar.gz rails-752432e82f3032e96ba609b65437cd8e8b8d3939.tar.bz2 rails-752432e82f3032e96ba609b65437cd8e8b8d3939.zip |
Regexp#=== is faster than String#=~
Discussion https://github.com/JuanitoFatas/fast-ruby/pull/59#issuecomment-128513763
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 3f4acf0745..42560f3515 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.any? { |regex| str =~ regex } + @regex_array.any? { |regex| regex === str } end private |