aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorJames Golick <james@giraffesoft.ca>2010-03-16 09:49:25 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2010-03-16 10:04:20 -0700
commit67d8b9743add53f908ca417c641c4a54dd326c7d (patch)
treecefe33c795c046ed904e21a0f21086ba0c3fafb8 /activesupport/lib/active_support
parent0db68fd1408e52b1edc62b18756ba2662f9b5b3c (diff)
downloadrails-67d8b9743add53f908ca417c641c4a54dd326c7d.tar.gz
rails-67d8b9743add53f908ca417c641c4a54dd326c7d.tar.bz2
rails-67d8b9743add53f908ca417c641c4a54dd326c7d.zip
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>
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/multibyte/utils.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/multibyte/utils.rb b/activesupport/lib/active_support/multibyte/utils.rb
index b243df46d8..94b393cee2 100644
--- a/activesupport/lib/active_support/multibyte/utils.rb
+++ b/activesupport/lib/active_support/multibyte/utils.rb
@@ -27,7 +27,7 @@ module ActiveSupport #:nodoc:
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