mirror of
https://github.com/AxioDL/tinyxml2.git
synced 2025-05-14 19:31:23 +00:00
Merge pull request #216 from Dmitry-Me/removeRepeatedIndexAccesses
Bind reference to avoid repeated accesses by index
This commit is contained in:
commit
d211bb1351
11
tinyxml2.cpp
11
tinyxml2.cpp
@ -212,12 +212,13 @@ const char* StrPair::GetStr()
|
|||||||
else {
|
else {
|
||||||
int i=0;
|
int i=0;
|
||||||
for(; i<NUM_ENTITIES; ++i ) {
|
for(; i<NUM_ENTITIES; ++i ) {
|
||||||
if ( strncmp( p+1, entities[i].pattern, entities[i].length ) == 0
|
const Entity& entity = entities[i];
|
||||||
&& *(p+entities[i].length+1) == ';' ) {
|
if ( strncmp( p + 1, entity.pattern, entity.length ) == 0
|
||||||
// Found an entity convert;
|
&& *( p + entity.length + 1 ) == ';' ) {
|
||||||
*q = entities[i].value;
|
// Found an entity - convert.
|
||||||
|
*q = entity.value;
|
||||||
++q;
|
++q;
|
||||||
p += entities[i].length + 2;
|
p += entity.length + 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user