From d347c2403605c5aa3ddd98fb605366914acab79f Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 10 Aug 2017 16:43:55 +0200 Subject: convert std::map::insert to std::map::emplace which is considerably less verbose Change-Id: Ifa373e8eb09e39bd6c8d3578641610a6055a187b Reviewed-on: https://gerrit.libreoffice.org/40978 Tested-by: Jenkins Reviewed-by: Noel Grandin --- basic/source/classes/codecompletecache.cxx | 8 ++++---- basic/source/classes/sbxmod.cxx | 2 +- basic/source/runtime/dllmgr-x64.cxx | 4 ++-- basic/source/runtime/dllmgr-x86.cxx | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'basic') diff --git a/basic/source/classes/codecompletecache.cxx b/basic/source/classes/codecompletecache.cxx index b3d003e23881..445132401574 100644 --- a/basic/source/classes/codecompletecache.cxx +++ b/basic/source/classes/codecompletecache.cxx @@ -126,7 +126,7 @@ void CodeCompleteDataCache::Clear() void CodeCompleteDataCache::InsertGlobalVar( const OUString& sVarName, const OUString& sVarType ) { - aGlobalVars.insert( CodeCompleteVarTypes::value_type(sVarName, sVarType) ); + aGlobalVars.emplace( sVarName, sVarType ); } void CodeCompleteDataCache::InsertLocalVar( const OUString& sProcName, const OUString& sVarName, const OUString& sVarType ) @@ -135,13 +135,13 @@ void CodeCompleteDataCache::InsertLocalVar( const OUString& sProcName, const OUS if( aIt == aVarScopes.end() ) //new procedure { CodeCompleteVarTypes aTypes; - aTypes.insert( CodeCompleteVarTypes::value_type(sVarName, sVarType) ); - aVarScopes.insert( CodeCompleteVarScopes::value_type(sProcName, aTypes) ); + aTypes.emplace( sVarName, sVarType ); + aVarScopes.emplace( sProcName, aTypes ); } else { CodeCompleteVarTypes aTypes = aVarScopes[ sProcName ]; - aTypes.insert( CodeCompleteVarTypes::value_type(sVarName, sVarType) ); + aTypes.emplace( sVarName, sVarType ); aVarScopes[ sProcName ] = aTypes; } } diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 61e1cfd7da6e..6cfb13b110ac 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -267,7 +267,7 @@ DocObjectWrapper::invoke( const OUString& aFunctionName, const Sequence< Any >& if ( pVar ) { SbxVariableRef xVar = pVar; - aOutParamMap.insert( OutParamMap::value_type( n - 1, sbxToUnoValue( xVar.get() ) ) ); + aOutParamMap.emplace( n - 1, sbxToUnoValue( xVar.get() ) ); } } } diff --git a/basic/source/runtime/dllmgr-x64.cxx b/basic/source/runtime/dllmgr-x64.cxx index d9242264ae0f..ffc05ddfeb5a 100644 --- a/basic/source/runtime/dllmgr-x64.cxx +++ b/basic/source/runtime/dllmgr-x64.cxx @@ -702,7 +702,7 @@ ErrCode Dll::getProc(OUString const & name, ProcData * proc) { } ErrCode e = getProcData(handle, name, proc); if (e == ERRCODE_NONE) { - procs.insert(Procs::value_type(name, *proc)); + procs.emplace(name, *proc); } return e; } @@ -734,7 +734,7 @@ public: Dll * SbiDllMgr::Impl::getDll(OUString const & name) { Dlls::iterator i(dlls.find(name)); if (i == dlls.end()) { - i = dlls.insert(Dlls::value_type(name, new Dll)).first; + i = dlls.emplace(name, new Dll).first; HMODULE h = LoadLibraryW(reinterpret_cast(name.getStr())); if (h == nullptr) { dlls.erase(i); diff --git a/basic/source/runtime/dllmgr-x86.cxx b/basic/source/runtime/dllmgr-x86.cxx index 3d5e9fbcf63d..2f3203e72751 100644 --- a/basic/source/runtime/dllmgr-x86.cxx +++ b/basic/source/runtime/dllmgr-x86.cxx @@ -656,7 +656,7 @@ ErrCode Dll::getProc(OUString const & name, ProcData * proc) { } ErrCode e = getProcData(handle, name, proc); if (e == ERRCODE_NONE) { - procs.insert(Procs::value_type(name, *proc)); + procs.emplace(name, *proc); } return e; } @@ -688,7 +688,7 @@ public: Dll * SbiDllMgr::Impl::getDll(OUString const & name) { Dlls::iterator i(dlls.find(name)); if (i == dlls.end()) { - i = dlls.insert(Dlls::value_type(name, new Dll)).first; + i = dlls.emplace(name, new Dll).first; HMODULE h = LoadLibraryW(reinterpret_cast(name.getStr())); if (h == 0) { dlls.erase(i); -- cgit