提交 1c7dd656 编写于 作者: N Nicolas Cavigneaux

Use `#tr` instead of `#gsub`

`#tr` is more efficient than `#gsub` and can be used as a drop in
replacement in this context.
上级 6bb040b5
......@@ -50,7 +50,7 @@ def scan
when text = @ss.scan(/(?<!\\):\w+/)
[:SYMBOL, text]
when text = @ss.scan(/(?:[\w%\-~!$&'*+,;=@]|\\:|\\\(|\\\))+/)
[:LITERAL, text.gsub('\\', '')]
[:LITERAL, text.tr('\\', '')]
# any char
when text = @ss.scan(/./)
[:LITERAL, text]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册