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:
Yorick Peterse 2015-02-16 21:26:54 +01:00
parent f83c03aaec
commit c36b35ac0f
1 changed files with 1 additions and 1 deletions

View File

@ -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
##