diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-08-10 16:43:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-08-11 12:38:32 +0200 |
commit | d347c2403605c5aa3ddd98fb605366914acab79f (patch) | |
tree | e39624030741234c514bccd858e69d6318dfba68 /extensions/source/ole | |
parent | python3: upgrade to release 3.5.4 (diff) | |
download | core-d347c2403605c5aa3ddd98fb605366914acab79f.tar.gz core-d347c2403605c5aa3ddd98fb605366914acab79f.zip |
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 'extensions/source/ole')
-rw-r--r-- | extensions/source/ole/oleobjw.cxx | 5 | ||||
-rw-r--r-- | extensions/source/ole/unoobjw.cxx | 8 |
2 files changed, 6 insertions, 7 deletions
diff --git a/extensions/source/ole/oleobjw.cxx b/extensions/source/ole/oleobjw.cxx index 414e707c9b15..14d63e450784 100644 --- a/extensions/source/ole/oleobjw.cxx +++ b/extensions/source/ole/oleobjw.cxx @@ -2394,7 +2394,7 @@ void IUnknownWrapper_Impl::buildComTlbIndex() if( SUCCEEDED(pType->GetNames( funcDesc->memid, & memberName, 1, &pcNames))) { OUString usName(reinterpret_cast<const sal_Unicode*>(LPCOLESTR(memberName))); - m_mapComFunc.insert( TLBFuncIndexMap::value_type( usName, i)); + m_mapComFunc.emplace(usName, i); } else { @@ -2421,8 +2421,7 @@ void IUnknownWrapper_Impl::buildComTlbIndex() if (varDesc->varkind == VAR_DISPATCH) { OUString usName(reinterpret_cast<const sal_Unicode*>(LPCOLESTR(memberName))); - m_mapComFunc.insert(TLBFuncIndexMap::value_type( - usName, i)); + m_mapComFunc.emplace(usName, i); } } else diff --git a/extensions/source/ole/unoobjw.cxx b/extensions/source/ole/unoobjw.cxx index 816360853cca..d89d86192d75 100644 --- a/extensions/source/ole/unoobjw.cxx +++ b/extensions/source/ole/unoobjw.cxx @@ -252,11 +252,11 @@ STDMETHODIMP InterfaceOleWrapper_Impl::GetIDsOfNames(REFIID /*riid*/, if (d.flags != 0) { m_MemberInfos.push_back(d); - iter = m_nameToDispIdMap.insert(NameToIdMap::value_type(exactName, (DISPID)m_MemberInfos.size())).first; + iter = m_nameToDispIdMap.emplace(exactName, (DISPID)m_MemberInfos.size()).first; if (exactName != name) { - iter = m_nameToDispIdMap.insert(NameToIdMap::value_type(name, (DISPID)m_MemberInfos.size())).first; + iter = m_nameToDispIdMap.emplace(name, (DISPID)m_MemberInfos.size()).first; } } } @@ -1263,12 +1263,12 @@ STDMETHODIMP UnoObjectWrapperRemoteOpt::GetIDsOfNames ( REFIID /*riid*/, OLECHA { // name has not been bad before( member exists typedef NameToIdMap::iterator ITnames; - pair< ITnames, bool > pair_id= m_nameToDispIdMap.insert( NameToIdMap::value_type(name, m_currentId++)); + pair< ITnames, bool > pair_id= m_nameToDispIdMap.emplace(name, m_currentId++); // new ID inserted ? if( pair_id.second ) {// yes, now create MemberInfo and ad to IdToMemberInfoMap MemberInfo d(0, name); - m_idToMemberInfoMap.insert( IdToMemberInfoMap::value_type( m_currentId - 1, d)); + m_idToMemberInfoMap.emplace(m_currentId - 1, d); } *rgdispid = pair_id.first->second; |