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 /basic | |
parent | 879fea59a0bcc1a439e51ab0923e1cc41dff5bfb (diff) |
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 'basic')
-rw-r--r-- | basic/source/uno/scriptcont.cxx | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx index 4346a091ff01..44ee7c787244 100644 --- a/basic/source/uno/scriptcont.cxx +++ b/basic/source/uno/scriptcont.cxx @@ -1241,11 +1241,8 @@ void SAL_CALL SfxScriptLibrary::insertModuleInfo( const OUString& ModuleName, co void SAL_CALL SfxScriptLibrary::removeModuleInfo( const OUString& ModuleName ) { // #FIXME add NoSuchElementException to the spec - if ( !hasModuleInfo( ModuleName ) ) - { + if ( mModuleInfo.erase( ModuleName ) == 0 ) throw NoSuchElementException(); - } - mModuleInfo.erase( mModuleInfo.find( ModuleName ) ); } } // namespace basic |