Don't use Array#uniq in NodeSet#initialize.

Removing this makes the process of parsing larger XML documents a bit faster.
The downside is that NodeSet#initialize will no longer filter out duplicate
nodes, though this is not something Oga itself relies upon.

Methods such as NodeSet#push still do ignore elements already present.
This commit is contained in:
Yorick Peterse committed 2015-03-21 01:22:59 +01:00
1 parent c36b35ac0f
commit fdcd712ffe
2 files changed
+1 -8

No files matched your search

+1 -1
View File
@@ -44,7 +44,7 @@ module Oga
# @param [Oga::XML::NodeSet] owner The owner of the set.
#
def initialize(nodes = [], owner = nil)
@nodes = nodes.uniq
@nodes = nodes
@owner = owner
@nodes.each { |node| take_ownership(node) } if owner