diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-04-15 01:13:22 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-04-15 03:05:26 +0200 |
commit | 4578ded393f8e97ae781f63c9a1cf57669409635 (patch) | |
tree | 0f9fb453b4f66580391216960775b9b0a4c26d1b /framework | |
parent | e07d5c089ab2e8fe8a5cfa2a11cef3f1cf3afab3 (diff) |
Simplify initialized check
The previous complexity did nothing useful; it allowed to have a single
unguarded boolean value check, for the cost of releasing and acquiring
the mutex again.
Change-Id: I426304e9ef6f27ca371544951bf3cc029887019e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150437
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/uielement/buttontoolbarcontroller.cxx | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/framework/source/uielement/buttontoolbarcontroller.cxx b/framework/source/uielement/buttontoolbarcontroller.cxx index 4972b6da7667..d94e5b0ff25f 100644 --- a/framework/source/uielement/buttontoolbarcontroller.cxx +++ b/framework/source/uielement/buttontoolbarcontroller.cxx @@ -90,21 +90,14 @@ void SAL_CALL ButtonToolbarController::release() noexcept void SAL_CALL ButtonToolbarController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) { - bool bInitialized( true ); - - { - SolarMutexGuard aSolarMutexGuard; - - if ( m_bDisposed ) - throw DisposedException(); + SolarMutexGuard aSolarMutexGuard; - bInitialized = m_bInitialized; - } + if ( m_bDisposed ) + throw DisposedException(); - if ( bInitialized ) + if ( m_bInitialized ) return; - SolarMutexGuard aSolarMutexGuard; m_bInitialized = true; PropertyValue aPropValue; |