Use parse_with_cache when querying xpath/css

This commit is contained in:
Yorick Peterse committed 2015-03-23 00:23:46 +01:00
1 parent 2c4e490614
commit 12aa21fb50
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -35,7 +35,7 @@ module Oga
# @see [Oga::XPath::Evaluator#initialize]
#
def css(expression)
ast = CSS::Parser.new(expression).parse
ast = CSS::Parser.parse_with_cache(expression)
return XPath::Evaluator.new(self).evaluate_ast(ast)
end
+1 -1
View File
@@ -82,7 +82,7 @@ module Oga
# @return [Mixed]
#
def evaluate(string)
ast = Parser.new(string).parse
ast = Parser.parse_with_cache(string)
return evaluate_ast(ast)
end