Skip to content

Commit

Permalink
Remove dead code and do a small performance improvement.
Browse files Browse the repository at this point in the history
  • Loading branch information
aslakhellesoy committed Dec 5, 2010
1 parent 0c73b72 commit 92df8d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 2 additions & 0 deletions History.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
== In Git

== 2.3.2 (2010-12-05)

(Somehow 2.3.1 was released improperly shortly after 2.3.0 - not sure what fixes went into that!)
Expand Down
15 changes: 8 additions & 7 deletions ragel/lexer.rb.rl.erb
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,6 @@ module Gherkin
%% write exec;
end

CRLF_RE = /\r\n/
LF_RE = /[^\r]\n/
CRLF = "\r\n"
LF = "\n"

def unindent(startcol, text)
text.gsub(/^[\t ]{0,#{startcol}}/, "")
end
Expand All @@ -166,8 +161,14 @@ module Gherkin
utf8_pack(rest[0..rest.index(10)||-1]).strip
end

def utf8_pack(array)
(RUBY_VERSION =~ /^1\.9/) ? array.pack("c*").force_encoding("UTF-8") : array.pack("c*")
if (RUBY_VERSION =~ /^1\.9/)
def utf8_pack(array)
array.pack("c*").force_encoding("UTF-8")
end
else
def utf8_pack(array)
array.pack("c*")
end
end
end
end
Expand Down

0 comments on commit 92df8d5

Please sign in to comment.