Merge pull request #610 from Dmitry-Me/reuseConversionCode

Extract and reuse conversion code
This commit is contained in:
Lee Thomason 2017-08-29 11:13:02 -07:00 committed by GitHub
commit b0c421d9a7
1 changed files with 3 additions and 2 deletions

View File

@ -2380,8 +2380,9 @@ XMLPrinter::XMLPrinter( FILE* file, bool compact, int depth ) :
}
for( int i=0; i<NUM_ENTITIES; ++i ) {
const char entityValue = entities[i].value;
TIXMLASSERT( ((unsigned char)entityValue) < ENTITY_RANGE );
_entityFlag[ (unsigned char)entityValue ] = true;
const unsigned char flagIndex = (unsigned char)entityValue;
TIXMLASSERT( flagIndex < ENTITY_RANGE );
_entityFlag[flagIndex] = true;
}
_restrictedEntityFlag[(unsigned char)'&'] = true;
_restrictedEntityFlag[(unsigned char)'<'] = true;