提交 67d8b974 编写于 作者: J James Golick 提交者: Jeremy Kemper

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: NJeremy Kemper <jeremy@bitsweat.net>
上级 0db68fd1
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册