2010-05-12 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Wed, 12 May 2010 15:04:05 +0000 (15:04 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Wed, 12 May 2010 15:04:05 +0000 (15:04 -0000)
* XmlNode.cs : use as-operator (isinst) to optimize certain use case.
  Patch by Tom Hindle.

svn path=/trunk/mcs/; revision=157244

mcs/class/System.XML/System.Xml/ChangeLog
mcs/class/System.XML/System.Xml/XmlNode.cs

index 026de3739270c8e46dc17fccdf51d9161b8f525e..0eb4cb353bcd3676338b07ad1f9f70652f79cd0b 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-12  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * XmlNode.cs : use as-operator (isinst) to optimize certain use case.
+         Patch by Tom Hindle.
+
 2010-04-28  Atsushi Enomoto  <atsushi@ximian.com>
 
        * XmlInputStream.cs : minimize initial buffer size so that it does
index 393a0f27c859738a4838e4aa3f0a45b6840c0683..115d77811daac968fb39d2fca451088c53cbc5c7 100644 (file)
@@ -864,7 +864,7 @@ namespace System.Xml
                        XPathNodeIterator iter = nav.Select (expr);
                        if (!iter.MoveNext ())
                                return null;
-                       return ((IHasXmlNode) iter.Current).GetNode ();
+                       return (iter.Current as IHasXmlNode).GetNode ();
                }
 
                public virtual bool Supports (string feature, string version)