Use parse_with_cache when querying xpath/css
This commit is contained in:
1 parent
2c4e490614
commit
12aa21fb50
2 files changed
+2
-2
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user