diff Lib/IMPL/DOM/Node.pm @ 36:1828103371d0

DOM in works
author Sergey
date Fri, 20 Nov 2009 16:48:08 +0300
parents a8086f85a571
children c2e7f7c96bcd
line wrap: on
line diff
--- a/Lib/IMPL/DOM/Node.pm	Tue Nov 17 17:46:24 2009 +0300
+++ b/Lib/IMPL/DOM/Node.pm	Fri Nov 20 16:48:08 2009 +0300
@@ -209,15 +209,13 @@
         if ($this->{$rootNode} ? $this->{$rootNode} != $newRoot : 1 ) {
             $this->{$rootNode} = $newRoot;
             weaken($this->{$rootNode});
-            if ($this->{$childNodes}) {
-                $_->_updateRootRefs foreach @{$this->{$childNodes}};
-            }
         }
     } elsif($this->{$rootNode}) {
         delete $this->{$rootNode};
-        if ($this->{$childNodes}) {
-            $_->_updateRootRefs foreach @{$this->{$childNodes}};
-        }
+    }
+    
+    if ($this->{$childNodes}) {
+        $_->_updateRootRefs foreach @{$this->{$childNodes}};
     }
 }