diff options
author | Robin Gareus <robin@gareus.org> | 2017-03-12 02:36:33 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-03-12 02:36:33 +0100 |
commit | 37bcbcad414774a4a390f15e8c1f6ffbf17699a3 (patch) | |
tree | d3e75ee47515488f20e806fc0074572c86a4278a /libs/ardour/session_state.cc | |
parent | 3e923470576d2867062d2b62291064cccc4dfe0f (diff) |
Optimize Session::set_dirty()
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r-- | libs/ardour/session_state.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 0c2fa42073..1b93e41c3c 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -3534,19 +3534,18 @@ Session::cleanup_trash_sources (CleanupReport& rep) void 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) { return; } - bool was_dirty = dirty(); - _state_of_the_state = StateOfTheState (_state_of_the_state | Dirty); - - if (!was_dirty) { - DirtyChanged(); /* EMIT SIGNAL */ - } + DirtyChanged(); /* EMIT SIGNAL */ } void |