Skip to content

Commit e18ebab

Browse files
committed
vastly improve Debug encoder speed on Ruby 1.9.3
1 parent af5d3ac commit e18ebab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/coderay/encoders/debug.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def text_token text, kind
2828
@out << text
2929
else
3030
# TODO: Escape (
31-
text = text.gsub(/[)\\]/, '\\\\\0') # escape ) and \
31+
text = text.gsub(/[)\\]/, '\\\\\0') if text.index(/[)\\]/)
3232
@out << kind.to_s << '(' << text << ')'
3333
end
3434
end

0 commit comments

Comments
 (0)