From c36b35ac0f62154f0ceca06eb2c18fd3161d3d19 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Mon, 16 Feb 2015 21:26:54 +0100 Subject: [PATCH] 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. --- lib/oga/xml/node_set.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/oga/xml/node_set.rb b/lib/oga/xml/node_set.rb index bcf44a8..a3bf283 100644 --- a/lib/oga/xml/node_set.rb +++ b/lib/oga/xml/node_set.rb @@ -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 ##