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 /unoxml | |
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 'unoxml')
-rw-r--r-- | unoxml/source/dom/document.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx index 8bd5a3eb7584..bc2969c7abec 100644 --- a/unoxml/source/dom/document.cxx +++ b/unoxml/source/dom/document.cxx @@ -97,11 +97,11 @@ namespace DOM { ::rtl::Reference<CDocument> const xDoc(new CDocument(pDoc)); // add the doc itself to its nodemap! - xDoc->m_NodeMap.insert( - nodemap_t::value_type(reinterpret_cast<xmlNodePtr>(pDoc), + xDoc->m_NodeMap.emplace( + reinterpret_cast<xmlNodePtr>(pDoc), ::std::make_pair( WeakReference<XNode>(static_cast<XDocument*>(xDoc.get())), - xDoc.get()))); + xDoc.get())); return xDoc; } @@ -260,10 +260,9 @@ namespace DOM } if (pCNode != nullptr) { - bool const bInserted = m_NodeMap.insert( - nodemap_t::value_type(pNode, - ::std::make_pair(WeakReference<XNode>(pCNode.get()), - pCNode.get())) + bool const bInserted = m_NodeMap.emplace( + pNode, + ::std::make_pair(WeakReference<XNode>(pCNode.get()), pCNode.get()) ).second; OSL_ASSERT(bInserted); if (!bInserted) { |