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/14 00:20:56 UTC
cvs commit: xml-xalan/c/src/PlatformSupport DoubleSupport.cpp
dbertoni 00/07/13 15:20:55
Modified: c/src/PlatformSupport DoubleSupport.cpp
Log:
Improved performance of DoubleSupport:doDouble() and fixed whitespace errors.
Revision Changes Path
1.9 +21 -7 xml-xalan/c/src/PlatformSupport/DoubleSupport.cpp
Index: DoubleSupport.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/DoubleSupport.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- DoubleSupport.cpp 2000/07/10 01:04:08 1.8
+++ DoubleSupport.cpp 2000/07/13 22:20:55 1.9
@@ -344,7 +344,11 @@
void
processWhitespace(const XalanDOMChar*& theString)
{
- while(*theString != 0 && isSpace(*theString) == true)
+ while(*theString != 0 &&
+ (*theString == 0x20 ||
+ *theString == 0xD ||
+ *theString == 0xA ||
+ *theString == 0x9))
{
++theString;
}
@@ -367,7 +371,7 @@
// faster...
unsigned long temp = 0;
- while(*theString && isDigit(*theString) == true)
+ while(*theString && *theString >= '0' && *theString <= '9')
{
temp *= 10;
temp += char(*theString) - '0';
@@ -387,7 +391,7 @@
// faster...
unsigned long temp = 0;
- while(*theString && isDigit(*theString) == true)
+ while(*theString && *theString >= '0' && *theString <= '9')
{
theDivisor *= 10;
@@ -485,10 +489,20 @@
}
break;
- case ' ':
- case '\t':
- fGotWhitespace = true;
- processWhitespace(theCurrent);
+ case 0x20:
+ case 0xD:
+ case 0x9:
+ case 0xA:
+ if (fGotWhitespace == true)
+ {
+ fError = true;
+ }
+ else
+ {
+ fGotWhitespace = true;
+
+ processWhitespace(theCurrent);
+ }
break;
default: