diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-08-11 11:36:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-08-11 13:51:29 +0200 |
commit | db17a874af37350b3270932175854ee674447bc1 (patch) | |
tree | fecc983fb75d3a4072cc7bd344fc824d548deb0d /desktop | |
parent | dd8a400bbbb1b8d5592a870f2036a4df3d005a7d (diff) |
convert std::map::insert to std::map::emplace II
Change-Id: Ief8bd59c903625ba65b75114b7b52c3b7ecbd331
Reviewed-on: https://gerrit.libreoffice.org/41019
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/deployment/misc/dp_update.cxx | 10 | ||||
-rw-r--r-- | desktop/source/deployment/registry/dp_registry.cxx | 9 |
2 files changed, 7 insertions, 12 deletions
diff --git a/desktop/source/deployment/misc/dp_update.cxx b/desktop/source/deployment/misc/dp_update.cxx index a3e0b4062534..9bde54bcad39 100644 --- a/desktop/source/deployment/misc/dp_update.cxx +++ b/desktop/source/deployment/misc/dp_update.cxx @@ -359,9 +359,8 @@ UpdateInfoMap getOnlineUpdateInfos( Reference<deployment::XPackage> extension = getExtensionWithHighestVersion(seqExt); OSL_ASSERT(extension.is()); - std::pair<UpdateInfoMap::iterator, bool> insertRet = infoMap.insert( - UpdateInfoMap::value_type( - dp_misc::getIdentifier(extension), UpdateInfo(extension))); + std::pair<UpdateInfoMap::iterator, bool> insertRet = infoMap.emplace( + dp_misc::getIdentifier(extension), UpdateInfo(extension)); OSL_ASSERT(insertRet.second); } } @@ -371,9 +370,8 @@ UpdateInfoMap getOnlineUpdateInfos( for (CIT i = extensionList->begin(); i != extensionList->end(); ++i) { OSL_ASSERT(i->is()); - std::pair<UpdateInfoMap::iterator, bool> insertRet = infoMap.insert( - UpdateInfoMap::value_type( - dp_misc::getIdentifier(*i), UpdateInfo(*i))); + std::pair<UpdateInfoMap::iterator, bool> insertRet = infoMap.emplace( + dp_misc::getIdentifier(*i), UpdateInfo(*i)); OSL_ASSERT(insertRet.second); } } diff --git a/desktop/source/deployment/registry/dp_registry.cxx b/desktop/source/deployment/registry/dp_registry.cxx index c0a629f585cc..08859be1a91b 100644 --- a/desktop/source/deployment/registry/dp_registry.cxx +++ b/desktop/source/deployment/registry/dp_registry.cxx @@ -202,9 +202,7 @@ void PackageRegistryImpl::insertBackend( // add parameterless media-type, too: sal_Int32 semi = mediaType.indexOf( ';' ); if (semi >= 0) { - m_mediaType2backend.insert( - t_string2registry::value_type( - mediaType.copy( 0, semi ), xBackend ) ); + m_mediaType2backend.emplace( mediaType.copy( 0, semi ), xBackend ); } const OUString fileFilter( xPackageType->getFileFilter() ); //The package backend shall also be called to determine the mediatype @@ -228,9 +226,8 @@ void PackageRegistryImpl::insertBackend( token.indexOf('?') >= 0); if (! ambig) { std::pair<t_string2string::iterator, bool> ins( - m_filter2mediaType.insert( - t_string2string::value_type( - token, mediaType ) ) ); + m_filter2mediaType.emplace( + token, mediaType ) ); ambig = !ins.second; if (ambig) { // filter has already been in: add previously |