You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by zo...@apache.org on 2006/06/07 21:54:04 UTC

svn commit: r412501 - /xalan/java/trunk/src/org/apache/xalan/xsltc/dom/DupFilterIterator.java

Author: zongaro
Date: Wed Jun  7 12:54:03 2006
New Revision: 412501

URL: http://svn.apache.org/viewvc?rev=412501&view=rev
Log:
Part of fix for XALANJ-2295.  Changed DupFilterIterator.setStartNode to take
advantage of the fact that if the source iterator is a KeyIndex, it will
return its nodes in document order, so no additional IntegerArray.sort operation
is necessary.

Reviewed by Christine Li (jycli () ca ! ibm ! com)

Modified:
    xalan/java/trunk/src/org/apache/xalan/xsltc/dom/DupFilterIterator.java

Modified: xalan/java/trunk/src/org/apache/xalan/xsltc/dom/DupFilterIterator.java
URL: http://svn.apache.org/viewvc/xalan/java/trunk/src/org/apache/xalan/xsltc/dom/DupFilterIterator.java?rev=412501&r1=412500&r2=412501&view=diff
==============================================================================
--- xalan/java/trunk/src/org/apache/xalan/xsltc/dom/DupFilterIterator.java (original)
+++ xalan/java/trunk/src/org/apache/xalan/xsltc/dom/DupFilterIterator.java Wed Jun  7 12:54:03 2006
@@ -84,7 +84,9 @@
 	if (_isRestartable) {
 	    // KeyIndex iterators are always relative to the root node, so there
 	    // is never any point in re-reading the iterator (and we SHOULD NOT).
-	    if (_source instanceof KeyIndex
+            boolean sourceIsKeyIndex = _source instanceof KeyIndex;
+
+	    if (sourceIsKeyIndex
                     && _startNode == DTMDefaultBase.ROOTNODE) {
 		return this;
 	    }
@@ -96,7 +98,13 @@
 		while ((node = _source.next()) != END) {
 		    _nodes.add(node);
 		}
-		_nodes.sort();
+
+                // Nodes produced by KeyIndex are known to be in document order.
+                // Take advantage of it.
+                if (!sourceIsKeyIndex) {
+                    _nodes.sort();
+                }
+
 		_nodesSize = _nodes.cardinality();
 		_current = 0;
 		_lastNext = END;



---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org