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/08 00:52:37 UTC

cvs commit: xml-xalan/c/src/XPath SimpleNodeLocator.cpp

dbertoni    00/07/07 15:52:36

  Modified:    c/src/XPath SimpleNodeLocator.cpp
  Log:
  Simplified code to find context node in the context node list.
  
  Revision  Changes    Path
  1.17      +6 -11     xml-xalan/c/src/XPath/SimpleNodeLocator.cpp
  
  Index: SimpleNodeLocator.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/SimpleNodeLocator.cpp,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- SimpleNodeLocator.cpp	2000/07/06 20:16:27	1.16
  +++ SimpleNodeLocator.cpp	2000/07/07 22:52:35	1.17
  @@ -650,18 +650,13 @@
   
   			step(xpath, executionContext, parentContext, startOpPos, mnl);
   
  -			const int			nNodes = mnl.getLength();
  -
  -			score = xpath.s_MatchScoreNone;
  -
  -			for(int i = 0; i < nNodes; i++)
  +			if (mnl.indexOf(localContext) == MutableNodeRefList::npos)
   			{
  -				if(mnl.item(i) == localContext)
  -				{
  -					score = xpath.s_MatchScoreOther;
  -
  -					break;
  -				}
  +				score = xpath.s_MatchScoreNone;
  +			}
  +			else
  +			{
  +				score = xpath.s_MatchScoreOther;
   			}
   		}
   	}