EbmlMaster.cpp: unwrap huge if; fix indentation

This commit is contained in:
Moritz Bunkus 2015-10-20 14:02:29 +02:00
parent ababb64e0c
commit 12b560adc2

View File

@ -398,8 +398,9 @@ void EbmlMaster::Sort()
*/ */
void EbmlMaster::Read(EbmlStream & inDataStream, const EbmlSemanticContext & sContext, int & UpperEltFound, EbmlElement * & FoundElt, bool AllowDummyElt, ScopeMode ReadFully) void EbmlMaster::Read(EbmlStream & inDataStream, const EbmlSemanticContext & sContext, int & UpperEltFound, EbmlElement * & FoundElt, bool AllowDummyElt, ScopeMode ReadFully)
{ {
if (ReadFully != SCOPE_NO_DATA) if (ReadFully == SCOPE_NO_DATA)
{ return;
EbmlElement * ElementLevelA; EbmlElement * ElementLevelA;
// remove all existing elements, including the mandatory ones... // remove all existing elements, including the mandatory ones...
size_t Index; size_t Index;
@ -481,6 +482,7 @@ void EbmlMaster::Read(EbmlStream & inDataStream, const EbmlSemanticContext & sCo
} }
} }
processCrc: processCrc:
EBML_MASTER_ITERATOR Itr, CrcItr; EBML_MASTER_ITERATOR Itr, CrcItr;
for (Itr = ElementList.begin(); Itr != ElementList.end();) { for (Itr = ElementList.begin(); Itr != ElementList.end();) {
if ((EbmlId)(*(*Itr)) == EBML_ID(EbmlCrc32)) { if ((EbmlId)(*(*Itr)) == EBML_ID(EbmlCrc32)) {
@ -492,14 +494,15 @@ void EbmlMaster::Read(EbmlStream & inDataStream, const EbmlSemanticContext & sCo
} }
++Itr; ++Itr;
} }
if (bChecksumUsed) if (bChecksumUsed)
{ {
delete *CrcItr; delete *CrcItr;
Remove(CrcItr); Remove(CrcItr);
} }
SetValueIsSet(); SetValueIsSet();
} }
}
void EbmlMaster::Remove(size_t Index) void EbmlMaster::Remove(size_t Index)
{ {