From 0ae9f844faf25d3be9f6fe5f8157f6bfebb30942 Mon Sep 17 00:00:00 2001 From: murphy Date: Sun, 2 Oct 2005 22:46:51 +0000 Subject: demo/coderay_demos.tar.gz: demos in a tgz encoders/null.rb: speeded up by hardcoding to_proc. --- lib/coderay/encoders/null.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib/coderay/encoders') diff --git a/lib/coderay/encoders/null.rb b/lib/coderay/encoders/null.rb index 67c4987..e995cb0 100644 --- a/lib/coderay/encoders/null.rb +++ b/lib/coderay/encoders/null.rb @@ -1,12 +1,20 @@ module CodeRay module Encoders + # = Null Encoder + # + # Does nothing and returns an empty string. class Null < Encoder include Streamable register_for :null - protected + # Defined for faster processing + def to_proc + proc {} + end + + protected def token(*) # do nothing @@ -16,5 +24,3 @@ module CodeRay end end - - -- cgit v1.2.1