diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2017-06-23 18:00:07 +0900 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2017-06-24 19:41:04 +0200 |
commit | 6ade3ef203238a211754c9c69000f155edd15ca9 (patch) | |
tree | 64471b9cda039b028fcd283b9055f83062a1e0a7 /toolkit | |
parent | gpp4libre: error handling, proper key extraction (diff) | |
download | core-6ade3ef203238a211754c9c69000f155edd15ca9.tar.gz core-6ade3ef203238a211754c9c69000f155edd15ca9.zip |
std::unordered_map can erase an element by given key, if any
so that it is unneeded to find its position in advance.
Change-Id: Iccf92f98b8683e4b2fb5252f5e05a357268b7033
Reviewed-on: https://gerrit.libreoffice.org/39156
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/controls/dialogcontrol.cxx | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index 06ce235374c1..48a8664ed9be 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -120,9 +120,8 @@ public: virtual void SAL_CALL removeByName( const OUString& aName ) override { ::osl::MutexGuard aGuard( m_aMutex ); - if ( !hasByName( aName ) ) + if ( things.erase( aName ) == 0 ) throw NoSuchElementException(); - things.erase( things.find( aName ) ); } virtual Type SAL_CALL getElementType( ) override { |