optimize isSpace for negative 8 bit bytes

This commit is contained in:
Dick Hollenbeck 2012-10-08 15:01:17 -05:00
parent 56796a950c
commit bb383e22b3
1 changed files with 3 additions and 1 deletions

View File

@ -375,7 +375,9 @@ int DSNLEXER::NeedNUMBER( const char* aExpectation ) throw( IO_ERROR )
*/ */
static bool isSpace( int cc ) static bool isSpace( int cc )
{ {
if( cc <= ' ' ) // cc was signed extended from signed char, so it is often negative.
// Treat negative as large positive to exclude rapidly.
if( unsigned( cc ) <= ' ' )
{ {
switch( cc ) switch( cc )
{ {