heavily optimized journal-cleanup - project unloading is now unbelievable fast

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1073 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-06-05 12:48:53 +00:00
parent 599d515791
commit dd06154ed6
5 changed files with 21 additions and 17 deletions

View File

@@ -105,8 +105,7 @@ void projectJournal::journalEntryAdded( const jo_id_t _id )
jo_id_t projectJournal::allocID( journallingObject * _obj )
{
const jo_id_t EO_ID_MAX = 1 << 20;
const jo_id_t EO_ID_MAX = 1 << 24;
jo_id_t id;
while( m_joIDs.contains( id = static_cast<jo_id_t>( (float) rand() /
RAND_MAX * EO_ID_MAX ) ) )
@@ -151,21 +150,21 @@ void projectJournal::forgetAboutID( const jo_id_t _id )
void projectJournal::clearInvalidJournallingObjects( void )
void projectJournal::clearJournal( void )
{
m_journalEntries.clear();
m_currentJournalEntry = m_journalEntries.end();
for( joIDMap::iterator it = m_joIDs.begin(); it != m_joIDs.end(); )
{
if( it.value() == NULL )
{
forgetAboutID( it.key() );
it = m_joIDs.begin();
it = m_joIDs.erase( it );
}
else
{
++it;
}
}
//clearJournal();
}

View File

@@ -730,7 +730,6 @@ void song::clearProject( void )
emit dataChanged();
engine::getProjectJournal()->clearInvalidJournallingObjects();
engine::getProjectJournal()->clearJournal();
engine::getProjectJournal()->setJournalling( TRUE );