From fa20b227a3bde7e791e63707266c961b636270f5 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Fri, 31 Oct 2014 12:53:04 +0300 Subject: [PATCH] Reuse IsWhiteSpace(), move comment. --- tinyxml2.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tinyxml2.h b/tinyxml2.h index 52b6d2c..2c9c155 100755 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -525,10 +525,8 @@ enum XMLError { class XMLUtil { public: - // Anything in the high order range of UTF-8 is assumed to not be whitespace. This isn't - // correct, but simple, and usually works. static const char* SkipWhiteSpace( const char* p ) { - while( !IsUTF8Continuation(*p) && isspace( *reinterpret_cast(p) ) ) { + while( IsWhiteSpace(*p) ) { ++p; } return p; @@ -536,6 +534,9 @@ public: static char* SkipWhiteSpace( char* p ) { return const_cast( SkipWhiteSpace( const_cast(p) ) ); } + + // Anything in the high order range of UTF-8 is assumed to not be whitespace. This isn't + // correct, but simple, and usually works. static bool IsWhiteSpace( char p ) { return !IsUTF8Continuation(p) && isspace( static_cast(p) ); }