Skip to content

Commit 752432e

Browse files
committed
Regexp#=== is faster than String#=~
Discussion fastruby/fast-ruby#59 (comment)
1 parent 9b7ecf0 commit 752432e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

activesupport/lib/active_support/inflector/inflections.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def add(words)
4949
end
5050

5151
def uncountable?(str)
52-
@regex_array.any? { |regex| str =~ regex }
52+
@regex_array.any? { |regex| regex === str }
5353
end
5454

5555
private

0 commit comments

Comments
 (0)