Use parse_with_cache when querying xpath/css
This commit is contained in:
parent
2c4e490614
commit
12aa21fb50
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue