Преглед изворни кода

Extract and reuse conversion code

Dmitry-Me пре 8 година
родитељ
комит
a28eb0763d
1 измењених фајлова са 3 додато и 2 уклоњено
  1. 3 2
      tinyxml2.cpp

+ 3 - 2
tinyxml2.cpp

@@ -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;