Use String#unpack instead of String#codepoints.

The latter returns an Enumerable which on Ruby 1.9.3 doesn't have #length
available. Besides this it's better to just return an Array since we'll iterate
over every character anyway.
This commit is contained in:
Yorick Peterse 2014-03-23 21:21:27 +01:00
parent a2452b6371
commit 19c1d66287
1 changed files with 1 additions and 1 deletions

View File

@ -95,7 +95,7 @@ module Oga
# @return [Array]
#
def lex(data)
@data = data.codepoints
@data = data.unpack('U*')
lexer_start = self.class.lexer_start
eof = data.length