Skip ownership iteration when there's no owner.
There's no point in iterating over all the nodes and assigning ownership if there's no owner to begin with.
This commit is contained in:
parent
f83c03aaec
commit
c36b35ac0f
|
@ -47,7 +47,7 @@ module Oga
|
|||
@nodes = nodes.uniq
|
||||
@owner = owner
|
||||
|
||||
@nodes.each { |node| take_ownership(node) }
|
||||
@nodes.each { |node| take_ownership(node) } if owner
|
||||
end
|
||||
|
||||
##
|
||||
|
|
Loading…
Reference in New Issue