Use NodeSet#concat for descendant-or-self.

In a sample XML file this removes around 3400 NodeSet allocations.
This commit is contained in:
Yorick Peterse 2014-09-05 10:56:49 +02:00
parent bcdce306e5
commit 8f562c24dd
1 changed files with 2 additions and 2 deletions

View File

@ -318,8 +318,8 @@ module Oga
nodes = XML::NodeSet.new
context.each do |context_node|
nodes += on_test(ast_node, context_node.children)
nodes += on_axis_descendant(ast_node, context_node.children)
nodes.concat(on_test(ast_node, context_node.children))
nodes.concat(on_axis_descendant(ast_node, context_node.children))
end
return nodes