knoaman     2002/12/11 14:09:08

  Modified:    c/src/xercesc/internal XMLReader.hpp
  Log:
  Performance: reduce instructions count.
  
  Revision  Changes    Path
  1.10      +10 -14    xml-xerces/c/src/xercesc/internal/XMLReader.hpp
  
  Index: XMLReader.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/XMLReader.hpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- XMLReader.hpp     3 Dec 2002 15:31:19 -0000       1.9
  +++ XMLReader.hpp     11 Dec 2002 22:09:08 -0000      1.10
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.10  2002/12/11 22:09:08  knoaman
  + * Performance: reduce instructions count.
  + *
    * Revision 1.9  2002/12/03 15:31:19  knoaman
    * Enable/disable calculation of src offset.
    *
  @@ -742,28 +745,21 @@
   // ---------------------------------------------------------------------------
   inline void XMLReader::movePlainContentChars(XMLBuffer &dest)
   {
  -    int count = 0;
  -    XMLCh *pStart = &fCharBuf[fCharIndex];
  -    XMLCh *pCurrent = pStart;
  -    XMLCh *pEnd     = &fCharBuf[fCharsAvail];
  -
  +    unsigned int count = fCharIndex;
   
  -    while (pCurrent < pEnd)
  +    while (fCharIndex < fCharsAvail)
       {
  -        if (! XMLReader::isPlainContentChar(*pCurrent++))
  +        if (!XMLReader::isPlainContentChar(fCharBuf[fCharIndex]))
               break;
  -        count++;
  +        fCharIndex++;
       }
   
  -    if (count > 0)
  +    if (count != fCharIndex)
       {
  -        fCharIndex += count;
  -        fCurCol    += count;
  -        dest.append(pStart, count);
  +        fCurCol    += (fCharIndex - count);
  +        dest.append(&fCharBuf[count], fCharIndex - count);
       }
   }
  -
  -
   
   
   // ---------------------------------------------------------------------------
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to