1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-26 00:03:52 +02:00

Added consistency checks for Sequence, hoisted out of inner loops.

This commit is contained in:
Paul Licameli
2016-02-03 12:56:21 -05:00
parent 7be911b7fb
commit 13f7d0a81b
3 changed files with 56 additions and 18 deletions

View File

@@ -461,7 +461,7 @@ bool Sequence::Copy(sampleCount s0, sampleCount s1, Sequence **dest)
DeleteSamples(buffer);
return true;
return ConsistencyCheck(wxT("Sequence::Copy()"));
}
bool Sequence::Paste(sampleCount s, const Sequence *src)
@@ -756,7 +756,7 @@ bool Sequence::AppendBlock(const SeqBlock &b)
mNumSamples += newBlock.f->GetLength();
// Don't do a consistency check here because this
// function gets called in an inner loop
// function gets called in an inner loop.
return true;
}
@@ -1870,6 +1870,9 @@ void Sequence::AppendBlockFile(BlockFile* blockFile)
mBlock.push_back(SeqBlock(blockFile, mNumSamples));
mNumSamples += blockFile->GetLength();
// PRL: I hoisted the intended consistency check out of the inner loop
// See RecordingRecoveryHandler::HandleXMLEndTag
#ifdef VERY_SLOW_CHECKING
ConsistencyCheck(wxT("AppendBlockFile"));
#endif