Optimize Session::set_dirty()
This commit is contained in:
parent
3e92347057
commit
37bcbcad41
@ -3534,20 +3534,19 @@ Session::cleanup_trash_sources (CleanupReport& rep)
|
|||||||
void
|
void
|
||||||
Session::set_dirty ()
|
Session::set_dirty ()
|
||||||
{
|
{
|
||||||
/* never mark session dirty during loading */
|
/* return early if there's nothing to do */
|
||||||
|
if (dirty ()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* never mark session dirty during loading */
|
||||||
if (_state_of_the_state & Loading) {
|
if (_state_of_the_state & Loading) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool was_dirty = dirty();
|
|
||||||
|
|
||||||
_state_of_the_state = StateOfTheState (_state_of_the_state | Dirty);
|
_state_of_the_state = StateOfTheState (_state_of_the_state | Dirty);
|
||||||
|
|
||||||
if (!was_dirty) {
|
|
||||||
DirtyChanged(); /* EMIT SIGNAL */
|
DirtyChanged(); /* EMIT SIGNAL */
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Session::set_clean ()
|
Session::set_clean ()
|
||||||
|
Loading…
Reference in New Issue
Block a user