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:
1 parent
c36b35ac0f
commit
fdcd712ffe
2 files changed
+1
-8
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user