Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improve performance of multibyte utils.

Switch from using String#match to using String#=~. There's no need to
generate a MatchData for each iteration since we're not using it.

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
commit 67d8b9743add53f908ca417c641c4a54dd326c7d 1 parent 0db68fd
@jamesgolick jamesgolick authored jeremy committed
Showing with 1 addition and 1 deletion.
  1. +1 −1  activesupport/lib/active_support/multibyte/utils.rb
View
2  activesupport/lib/active_support/multibyte/utils.rb
@@ -27,7 +27,7 @@ def self.verify(string)
def self.verify(string)
if expression = valid_character
# Splits the string on character boundaries, which are determined based on $KCODE.
- string.split(//).all? { |c| expression.match(c) }
+ string.split(//).all? { |c| expression =~ c }
else
true
end
Please sign in to comment.
Something went wrong with that request. Please try again.