2002-03-13 Duncan Mak <duncan@ximian.com>
[mono.git] / mcs / class / System.XML / System.Xml / XmlElement.cs
index 857517c24f4532734dac8fd556f9ab46b564ad3d..670b514c9f307be8c1bd3bf17123480fb868102b 100644 (file)
@@ -16,7 +16,7 @@ namespace System.Xml
                #region Fields
 
                private XmlAttributeCollection attributes;
-               private XmlLinkedNode lastChild;
+               private XmlLinkedNode lastLinkedChild;
                private string localName;
                private string namespaceURI;
                private string prefix;
@@ -87,36 +87,13 @@ namespace System.Xml
                        }
                }
 
-               internal override XmlLinkedNode LastLinkedChild
-               {
-                       get     
-                       {
-                               return lastChild;
+               internal override XmlLinkedNode LastLinkedChild {
+                       get     {
+                               return lastLinkedChild;
                        }
-                       /// set'er Should only be called by XmlNode.AppendChild().
-                       set 
-                       {
-                               // This is our special case for clearing out all children.
-                               // XmlNode.RemoveAll() will call this method passing in
-                               // a null node.
-                               if (value == null)
-                               {
-                                       // This should allow the GC to collect up our circular list
-                                       // that we no longer have a reference to.
-                                       lastChild = null;
-                                       return;
-                               }
-
-                               if (LastChild == null) 
-                               {
-                                       lastChild = value;
-                                       LastLinkedChild.NextLinkedSibling = null;
-                               }
-                               
-                               value.NextLinkedSibling = LastLinkedChild.NextLinkedSibling;
-                               LastLinkedChild.NextLinkedSibling = value;
-
-                               SetParentNode(this);
+
+                       set {
+                               lastLinkedChild = value;
                        }
                }