You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by am...@apache.org on 2008/04/17 19:55:01 UTC

svn commit: r649206 - /xerces/c/trunk/src/xercesc/internal/XMLReader.hpp

Author: amassari
Date: Thu Apr 17 10:54:59 2008
New Revision: 649206

URL: http://svn.apache.org/viewvc?rev=649206&view=rev
Log:
PPerformance improvements

Modified:
    xerces/c/trunk/src/xercesc/internal/XMLReader.hpp

Modified: xerces/c/trunk/src/xercesc/internal/XMLReader.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/internal/XMLReader.hpp?rev=649206&r1=649205&r2=649206&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/internal/XMLReader.hpp (original)
+++ xerces/c/trunk/src/xercesc/internal/XMLReader.hpp Thu Apr 17 10:54:59 2008
@@ -624,19 +624,16 @@
 // ---------------------------------------------------------------------------
 inline void XMLReader::movePlainContentChars(XMLBuffer &dest)
 {
-    XMLSize_t count = fCharIndex;
+    const XMLCh* cursor = &fCharBuf[fCharIndex], *start = cursor, *end = &fCharBuf[fCharsAvail];
 
-    while (fCharIndex < fCharsAvail)
-    {
-        if (!isPlainContentChar(fCharBuf[fCharIndex]))
-            break;
-        fCharIndex++;
-    }
+    while (cursor < end && isPlainContentChar(*cursor))
+        cursor++;
 
-    if (count != fCharIndex)
+    if (cursor != start)
     {
-        fCurCol    += (unsigned long)(fCharIndex - count);
-        dest.append(&fCharBuf[count], fCharIndex - count);
+        fCharIndex  = cursor - fCharBuf;
+        fCurCol    += (unsigned long)(cursor - start);
+        dest.append(start, cursor - start);
     }
 }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org