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 /unoxml | |
parent | f0e68d4feaaa43f7450432ad1ebd92c2b572400f (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 'unoxml')
-rw-r--r-- | unoxml/source/dom/saxbuilder.cxx | 6 | ||||
-rw-r--r-- | unoxml/source/events/eventdispatcher.cxx | 4 | ||||
-rw-r--r-- | unoxml/source/xpath/xpathapi.cxx | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/unoxml/source/dom/saxbuilder.cxx b/unoxml/source/dom/saxbuilder.cxx index cfed6c80e20e..33c7b2b9b2e3 100644 --- a/unoxml/source/dom/saxbuilder.cxx +++ b/unoxml/source/dom/saxbuilder.cxx @@ -210,16 +210,16 @@ namespace DOM if (attr_qname.startsWith("xmlns:")) { newprefix = attr_qname.copy(attr_qname.indexOf(':')+1); - aNSMap.insert(NSMap::value_type(newprefix, attr_value)); + aNSMap.emplace(newprefix, attr_value); } else if ( attr_qname == "xmlns" ) { // new default prefix - aNSMap.insert(NSMap::value_type(OUString(), attr_value)); + aNSMap.emplace(OUString(), attr_value); } else { - aAttrMap.insert(AttrMap::value_type(attr_qname, attr_value)); + aAttrMap.emplace(attr_qname, attr_value); } } diff --git a/unoxml/source/events/eventdispatcher.cxx b/unoxml/source/events/eventdispatcher.cxx index 0dab5b9d0624..54cbf4c3267e 100644 --- a/unoxml/source/events/eventdispatcher.cxx +++ b/unoxml/source/events/eventdispatcher.cxx @@ -44,13 +44,13 @@ namespace DOM { namespace events { auto tIter = pTMap->find(aType); if (tIter == pTMap->end()) { // the map has to be created - auto const pair = pTMap->insert(TypeListenerMap::value_type(aType, ListenerMap())); + auto const pair = pTMap->emplace(aType, ListenerMap()); pMap = & pair.first->second; } else { pMap = & tIter->second; } assert(pMap != nullptr); - pMap->insert(ListenerMap::value_type(pNode, aListener)); + pMap->emplace(pNode, aListener); } void CEventDispatcher::removeListener(xmlNodePtr pNode, const OUString& aType, const Reference<XEventListener>& aListener, bool bCapture) diff --git a/unoxml/source/xpath/xpathapi.cxx b/unoxml/source/xpath/xpathapi.cxx index bae64f8fda45..63e21a1fe26e 100644 --- a/unoxml/source/xpath/xpathapi.cxx +++ b/unoxml/source/xpath/xpathapi.cxx @@ -99,7 +99,7 @@ namespace XPath { ::osl::MutexGuard const g(m_Mutex); - m_nsmap.insert(nsmap_t::value_type(aPrefix, aURI)); + m_nsmap.emplace(aPrefix, aURI); } void SAL_CALL CXPathAPI::unregisterNS( |