reduce memory use on Attribute() caused by Attributes().
[mono.git] / mcs / class / System.Xml.Linq / System.Xml.XPath / Extensions.cs
index 0f2bdeee6d5ff480ccd4e95d8062ea29f2a680d2..10a91c3030d7dc2f91ea65d0b10cc1d33f9be4b1 100644 (file)
@@ -24,8 +24,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !MOONLIGHT
-
 using System;
 using System.Collections;
 using System.Collections.Generic;
@@ -59,11 +57,11 @@ namespace System.Xml.XPath
                        return GetUnderlyingXObjects((XPathNodeIterator) navigationResult);
                }
 
-               private static IEnumerable<XObject> GetUnderlyingXObjects(XPathNodeIterator nodeIterator)
+               private static IEnumerable<object> GetUnderlyingXObjects(XPathNodeIterator nodeIterator)
                {
                        foreach (XPathNavigator nav in nodeIterator)
                        {
-                               yield return (XObject)(nav.UnderlyingObject);
+                               yield return nav.UnderlyingObject;
                        }
                }
 
@@ -95,5 +93,3 @@ namespace System.Xml.XPath
                }
        }
 }
-
-#endif