xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbert...@apache.org
Subject cvs commit: xml-xalan/c/src/XPath XPath.cpp
Date Fri, 30 Nov 2001 22:11:21 GMT
dbertoni    01/11/30 14:11:21

  Modified:    c/src/XPath XPath.cpp
  Log:
  Added node list optimizations.
  
  Revision  Changes    Path
  1.66      +41 -1     xml-xalan/c/src/XPath/XPath.cpp
  
  Index: XPath.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPath.cpp,v
  retrieving revision 1.65
  retrieving revision 1.66
  diff -u -r1.65 -r1.66
  --- XPath.cpp	2001/11/08 03:44:57	1.65
  +++ XPath.cpp	2001/11/30 22:11:21	1.66
  @@ -1300,11 +1300,24 @@
   				{
   					if(queryResults.getLength() == 0)
   					{
  +						if (mnl->getReverseDocumentOrder() == true)
  +						{
  +							mnl->reverse();
  +
  +							queryResults.setDocumentOrder();
  +						}
  +						else if (mnl->getDocumentOrder() == true)
  +						{
  +							queryResults.setDocumentOrder();
  +						}
  +
   						queryResults = *mnl;
   					}
   					else
   					{
   						queryResults.addNodesInDocOrder(*mnl, executionContext);
  +
  +						queryResults.setDocumentOrder();
   					}
   				}
   			}
  @@ -1314,7 +1327,30 @@
   	{
   		if (shouldReorder == true)
   		{
  -			queryResults.addNodesInDocOrder(*subQueryResults, executionContext);
  +			if (queryResults.getLength() != 0 ||
  +				subQueryResults->getUnknownOrder() == true)
  +			{
  +				queryResults.addNodesInDocOrder(*subQueryResults, executionContext);
  +			}
  +			else
  +			{
  +				if (subQueryResults->getReverseDocumentOrder() == true)
  +				{
  +					subQueryResults->reverse();
  +
  +					queryResults = *subQueryResults;
  +				}
  +				else if (subQueryResults->getDocumentOrder() == true)
  +				{
  +					queryResults = *subQueryResults;
  +				}
  +				else
  +				{
  +					assert(false);
  +				}
  +			}
  +
  +			queryResults.setDocumentOrder();
   		}
   		else
   		{
  @@ -1739,6 +1775,8 @@
   
   	subQueryResults.addNode(docContext);
   
  +	subQueryResults.setDocumentOrder();
  +
   	return argLen + 3;
   }
   
  @@ -1997,6 +2035,8 @@
   				}
   			}
   		}
  +
  +		subQueryResults.setDocumentOrder();
   	}
   
   	return argLen + 3;
  
  
  

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


Mime
View raw message