From 19c1d662877b66df90e9bf155129fa8ce7a8d3b2 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Sun, 23 Mar 2014 21:21:27 +0100 Subject: [PATCH] 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. --- lib/oga/lexer.rl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/oga/lexer.rl b/lib/oga/lexer.rl index 2f4560d..27c9f6c 100644 --- a/lib/oga/lexer.rl +++ b/lib/oga/lexer.rl @@ -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