summaryrefslogtreecommitdiff
path: root/cppu
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-08-10 16:43:55 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-08-11 12:38:32 +0200
commitd347c2403605c5aa3ddd98fb605366914acab79f (patch)
treee39624030741234c514bccd858e69d6318dfba68 /cppu
parentf0e68d4feaaa43f7450432ad1ebd92c2b572400f (diff)
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 <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cppu')
-rw-r--r--cppu/source/threadpool/threadpool.cxx2
-rw-r--r--cppu/source/uno/lbenv.cxx7
2 files changed, 4 insertions, 5 deletions
diff --git a/cppu/source/threadpool/threadpool.cxx b/cppu/source/threadpool/threadpool.cxx
index a508f56e6aec..39774c9eec69 100644
--- a/cppu/source/threadpool/threadpool.cxx
+++ b/cppu/source/threadpool/threadpool.cxx
@@ -408,7 +408,7 @@ uno_threadpool_create() SAL_THROW_EXTERN_C()
// Just ensure that the handle is unique in the process (via heap)
uno_ThreadPool h = new struct _uno_ThreadPool;
- g_pThreadpoolHashSet->insert( ThreadpoolHashSet::value_type(h, p) );
+ g_pThreadpoolHashSet->emplace( h, p );
return h;
}
diff --git a/cppu/source/uno/lbenv.cxx b/cppu/source/uno/lbenv.cxx
index 116c02e8ab77..aefadc80fdeb 100644
--- a/cppu/source/uno/lbenv.cxx
+++ b/cppu/source/uno/lbenv.cxx
@@ -170,8 +170,7 @@ inline void ObjectEntry::append(
aNewEntry.pTypeDescr = pTypeDescr;
std::pair< Ptr2ObjectMap::iterator, bool > i(
- pEnv->aPtr2ObjectMap.insert( Ptr2ObjectMap::value_type(
- pInterface, this ) ) );
+ pEnv->aPtr2ObjectMap.emplace( pInterface, this ) );
SAL_WARN_IF(
!i.second && (find(pInterface, 0) == -1 || i.first->second != this),
"cppu",
@@ -241,7 +240,7 @@ static void SAL_CALL defenv_registerInterface(
// try to insert dummy 0:
std::pair<OId2ObjectMap::iterator, bool> const insertion(
- that->aOId2ObjectMap.insert( OId2ObjectMap::value_type( rOId, nullptr ) ) );
+ that->aOId2ObjectMap.emplace( rOId, nullptr ) );
if (insertion.second)
{
ObjectEntry * pOEntry = new ObjectEntry( rOId );
@@ -289,7 +288,7 @@ static void SAL_CALL defenv_registerProxyInterface(
// try to insert dummy 0:
std::pair<OId2ObjectMap::iterator, bool> const insertion(
- that->aOId2ObjectMap.insert( OId2ObjectMap::value_type( rOId, nullptr ) ) );
+ that->aOId2ObjectMap.emplace( rOId, nullptr ) );
if (insertion.second)
{
ObjectEntry * pOEntry = new ObjectEntry( rOId );