Author: atsushi
Date: 2006-02-20 09:35:40 -0500 (Mon, 20 Feb 2006)
New Revision: 57067

Modified:
   trunk/mcs/class/System.XML/System.Xml/ChangeLog
   trunk/mcs/class/System.XML/System.Xml/XmlNodeReaderImpl.cs
Log:
2006-02-20  Atsushi Enomoto <[EMAIL PROTECTED]>

        * XmlNodeReaderImpl.cs : optimized Depth.



Modified: trunk/mcs/class/System.XML/System.Xml/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/System.Xml/ChangeLog     2006-02-20 13:07:13 UTC 
(rev 57066)
+++ trunk/mcs/class/System.XML/System.Xml/ChangeLog     2006-02-20 14:35:40 UTC 
(rev 57067)
@@ -1,5 +1,9 @@
 2006-02-20  Atsushi Enomoto <[EMAIL PROTECTED]>
 
+       * XmlNodeReaderImpl.cs : optimized Depth.
+
+2006-02-20  Atsushi Enomoto <[EMAIL PROTECTED]>
+
        * XmlValidatingReader.cs : reducing layered ReadState invocation
          results in 10% speed up.
 

Modified: trunk/mcs/class/System.XML/System.Xml/XmlNodeReaderImpl.cs
===================================================================
--- trunk/mcs/class/System.XML/System.Xml/XmlNodeReaderImpl.cs  2006-02-20 
13:07:13 UTC (rev 57066)
+++ trunk/mcs/class/System.XML/System.Xml/XmlNodeReaderImpl.cs  2006-02-20 
14:35:40 UTC (rev 57067)
@@ -133,14 +133,10 @@
 
                public override int Depth {
                        get {
-                               if (current == null)
-                                       return 0;
-                               if (current.NodeType == XmlNodeType.Attribute)
-                                       return depth + 1;
-                               if (current.ParentNode != null && 
current.ParentNode.NodeType == XmlNodeType.Attribute)
-                                       return depth + 2;
-
-                               return depth;
+                               return current == null ? 0 :
+                                       current == ownerLinkedNode ? depth :
+                                       current.NodeType == 
XmlNodeType.Attribute ? depth + 1 :
+                                       depth + 2;
                        }
                }
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to