Author: atsushi
Date: 2005-03-08 05:48:37 -0500 (Tue, 08 Mar 2005)
New Revision: 41556
Modified:
trunk/mcs/class/System.XML/System.Xml.XPath/ChangeLog
trunk/mcs/class/System.XML/System.Xml.XPath/Iterator.cs
Log:
2004-03-04 Atsushi Enomoto <[EMAIL PROTECTED]>
* Iterator.cs : (SlashIterator.MoveNext()) For SortedList.Add(), the
key should be iterator itself. Key by list count never makes sense.
Modified: trunk/mcs/class/System.XML/System.Xml.XPath/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/System.Xml.XPath/ChangeLog 2005-03-08
09:31:17 UTC (rev 41555)
+++ trunk/mcs/class/System.XML/System.Xml.XPath/ChangeLog 2005-03-08
10:48:37 UTC (rev 41556)
@@ -1,5 +1,10 @@
2004-03-04 Atsushi Enomoto <[EMAIL PROTECTED]>
+ * Iterator.cs : (SlashIterator.MoveNext()) For SortedList.Add(), the
+ key should be iterator itself. Key by list count never makes sense.
+
+2004-03-04 Atsushi Enomoto <[EMAIL PROTECTED]>
+
* Expression.cs : Significant whitespace nodes must be returned in
text() NodeTypeTest.
Modified: trunk/mcs/class/System.XML/System.Xml.XPath/Iterator.cs
===================================================================
--- trunk/mcs/class/System.XML/System.Xml.XPath/Iterator.cs 2005-03-08
09:31:17 UTC (rev 41555)
+++ trunk/mcs/class/System.XML/System.Xml.XPath/Iterator.cs 2005-03-08
10:48:37 UTC (rev 41556)
@@ -845,6 +845,7 @@
{
_iterLeft = iter;
_expr = expr;
+
if (_iterLeft.RequireSorting || _expr.RequireSorting)
CollectResults ();
}
@@ -898,17 +899,8 @@
while (!_iterRight.MoveNext ()) {
if (_iterList.Count > 0) {
int last = _iterList.Count - 1;
- BaseIterator tmpIter =
(BaseIterator) _iterList.GetByIndex (last);
+ _iterRight = (BaseIterator)
_iterList.GetByIndex (last);
_iterList.RemoveAt (last);
- switch
(tmpIter.Current.ComparePosition (_iterRight.Current)) {
- case XmlNodeOrder.Same:
- case XmlNodeOrder.Before:
- _iterRight = tmpIter;
- continue;
- default:
- _iterRight = tmpIter;
- break;
- }
break;
} else if (_nextIterRight != null) {
_iterRight = _nextIterRight;
@@ -940,7 +932,7 @@
if (_nextIterRight != null) {
switch
(_iterRight.Current.ComparePosition (_nextIterRight.Current)) {
case XmlNodeOrder.After:
- _iterList.Add
(_iterList.Count, _iterRight);
+ _iterList [_iterRight]
= _iterRight;
_iterRight =
_nextIterRight;
_nextIterRight = null;
loop = true;
@@ -951,8 +943,8 @@
else {
int last =
_iterList.Count;
- if (last > 0) {
-
_iterList.Add (last, _nextIterRight);
+ _iterList
[_nextIterRight] = _nextIterRight;
+ if (last !=
_iterList.Count) {
_nextIterRight = (BaseIterator) _iterList.GetByIndex (last);
_iterList.RemoveAt (last);
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches