Author: atsushi
Date: 2005-03-09 15:06:59 -0500 (Wed, 09 Mar 2005)
New Revision: 41614

Modified:
   trunk/mcs/class/System.XML/System.Xml.XPath/ChangeLog
   trunk/mcs/class/System.XML/System.Xml.XPath/Expression.cs
   trunk/mcs/class/System.XML/System.Xml.XPath/Iterator.cs
Log:
2004-03-09  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * Expression.cs,
          Iterator.cs, :
          SlashIterator is now constructed with requireSorting parameter 
          that thus just use RequireSorting from both left/right Expressions, 
          not iterators.
          When attribute axis is on the left expression, the result needs to
          be sorted.



Modified: trunk/mcs/class/System.XML/System.Xml.XPath/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/System.Xml.XPath/ChangeLog       2005-03-09 
19:57:21 UTC (rev 41613)
+++ trunk/mcs/class/System.XML/System.Xml.XPath/ChangeLog       2005-03-09 
20:06:59 UTC (rev 41614)
@@ -1,5 +1,15 @@
 2004-03-09  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
+       * Expression.cs,
+         Iterator.cs, :
+         SlashIterator is now constructed with requireSorting parameter 
+         that thus just use RequireSorting from both left/right Expressions, 
+         not iterators.
+         When attribute axis is on the left expression, the result needs to
+         be sorted.
+
+2004-03-09  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
        * Iterator.cs : Now for most of iterator types, Current property always
          returns the same instance. It results in huge memory reduction.
 

Modified: trunk/mcs/class/System.XML/System.Xml.XPath/Expression.cs
===================================================================
--- trunk/mcs/class/System.XML/System.Xml.XPath/Expression.cs   2005-03-09 
19:57:21 UTC (rev 41613)
+++ trunk/mcs/class/System.XML/System.Xml.XPath/Expression.cs   2005-03-09 
20:06:59 UTC (rev 41614)
@@ -984,7 +984,7 @@
                public override object Evaluate (BaseIterator iter)
                {
                        BaseIterator iterLeft = left.EvaluateNodeSet (iter);
-                       return new SlashIterator (iterLeft, right);
+                       return new SlashIterator (iterLeft, right, 
left.RequireSorting || right.RequireSorting);
                }
 
                public override bool RequireSorting { get { return 
left.RequireSorting || right.RequireSorting; } }
@@ -1019,9 +1019,11 @@
                        return new SlashIterator (
                                new SlashIterator (
                                        left.EvaluateNodeSet (iter),
-                                       DescendantOrSelfStar
+                                       DescendantOrSelfStar,
+                                       left.RequireSorting || 
DescendantOrSelfStar.RequireSorting
                                ),
-                               right
+                               right,
+                               DescendantOrSelfStar.RequireSorting || 
right.RequireSorting
                        );
                }
 
@@ -1193,6 +1195,7 @@
                                case Axes.AncestorOrSelf:
                                case Axes.Preceding:
                                case Axes.PrecedingSibling:
+                               case Axes.Attribute:
                                case Axes.Namespace:
                                        return true;
                                default:

Modified: trunk/mcs/class/System.XML/System.Xml.XPath/Iterator.cs
===================================================================
--- trunk/mcs/class/System.XML/System.Xml.XPath/Iterator.cs     2005-03-09 
19:57:21 UTC (rev 41613)
+++ trunk/mcs/class/System.XML/System.Xml.XPath/Iterator.cs     2005-03-09 
20:06:59 UTC (rev 41614)
@@ -841,12 +841,12 @@
                bool _finished;
                BaseIterator _nextIterRight;
 
-               public SlashIterator (BaseIterator iter, NodeSet expr) : base 
(iter.NamespaceManager)
+               public SlashIterator (BaseIterator iter, NodeSet expr, bool 
requireSorting) : base (iter.NamespaceManager)
                {
                        _iterLeft = iter;
                        _expr = expr;
 
-                       if (_iterLeft.RequireSorting || _expr.RequireSorting)
+                       if (requireSorting)
                                CollectResults ();
                }
 

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

Reply via email to