Author: amassari
Date: Wed Jul 23 01:57:00 2008
New Revision: 679033

URL: http://svn.apache.org/viewvc?rev=679033&view=rev
Log:
Performance improvement

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

Modified: xerces/c/trunk/src/xercesc/internal/XMLReader.cpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/internal/XMLReader.cpp?rev=679033&r1=679032&r2=679033&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/internal/XMLReader.cpp (original)
+++ xerces/c/trunk/src/xercesc/internal/XMLReader.cpp Wed Jul 23 01:57:00 2008
@@ -750,10 +750,14 @@
             }
         }
 
-        while (fCharIndex < fCharsAvail) {
-            //  Check the current char and take it if its a name char. Else
+        while(true)
+        {
+            //  Check the current char and take it if it's a name char. Else
             //  break out.
-            if ( (fCharBuf[fCharIndex] >= 0xD800) && (fCharBuf[fCharIndex] <= 
0xDB7F) )
+            for (;(fCharIndex < fCharsAvail) && 
((fgCharCharsTable[fCharBuf[fCharIndex]] & gNCNameCharMask) != 0);fCharIndex++);
+
+            // if it isn't a NameChar, it could be a surrogate
+            if ( (fCharIndex < fCharsAvail) && (fCharBuf[fCharIndex] >= 
0xD800) && (fCharBuf[fCharIndex] <= 0xDB7F) )
             {
                 // make sure one more char is in the buffer, the transcoder
                 // should put only a complete surrogate pair into the buffer
@@ -767,11 +771,7 @@
                 fCharIndex += 2;
                 continue;
             }
-
-            if ((fgCharCharsTable[fCharBuf[fCharIndex]] & gNCNameCharMask) == 
0)
-                break;
-
-            fCharIndex++;
+            break;
         }
 
         // we have to copy the accepted character(s), and update column



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

Reply via email to