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;
                        }
                }
        }
  
  
  

Reply via email to