You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@locus.apache.org on 2000/07/01 23:56:20 UTC

cvs commit: xml-xalan/c/src/XSLT NodeSorter.cpp

dbertoni    00/07/01 14:56:19

  Modified:    c/src/XSLT NodeSorter.cpp
  Log:
  Made sorts stable.
  
  Revision  Changes    Path
  1.7       +6 -4      xml-xalan/c/src/XSLT/NodeSorter.cpp
  
  Index: NodeSorter.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/NodeSorter.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- NodeSorter.cpp	2000/04/21 20:29:01	1.6
  +++ NodeSorter.cpp	2000/07/01 21:56:18	1.7
  @@ -122,13 +122,15 @@
   	const unsigned int	theLength = theList.getLength();
   
   	// Copy the nodes to a vector...
  -	NodeVectorType	theNodes(theLength);
  +	NodeVectorType	theNodes;
   
  +	theNodes.reserve(theLength);
  +
   	unsigned int		i = 0;
   
   	for (; i < theLength; ++i)
   	{
  -		theNodes[i] = theList.item(i);
  +		theNodes.push_back(theList.item(i));
   	}
   
   	sort(theNodes,
  @@ -185,7 +187,7 @@
   		{
   			const double	diff = n1Num - n2Num;
   
  -			theResult =  diff < 0.0 ? true : false;
  +			theResult =  diff <= 0.0 ? true : false;
   
   			if (theKey.getDescending() == true)
   			{
  @@ -207,7 +209,7 @@
   		}
   		else
   		{
  -			theResult = theCompareResult < 0 ? true : false;
  +			theResult = theCompareResult <= 0 ? true : false;
   
   			if (theKey.getDescending() == true)
   			{