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 /codemaker/source/cppumaker | |
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 'codemaker/source/cppumaker')
-rw-r--r-- | codemaker/source/cppumaker/cpputype.cxx | 14 | ||||
-rw-r--r-- | codemaker/source/cppumaker/dependencies.cxx | 3 | ||||
-rw-r--r-- | codemaker/source/cppumaker/includes.cxx | 3 |
3 files changed, 7 insertions, 13 deletions
diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx index a8ac2ba4822c..28efa3fbf1f9 100644 --- a/codemaker/source/cppumaker/cpputype.cxx +++ b/codemaker/source/cppumaker/cpputype.cxx @@ -2025,9 +2025,8 @@ void PlainStructType::dumpComprehensiveGetCppuType(FileStream & out) std::map< OUString, sal_uInt32 > types; std::vector< unoidl::PlainStructTypeEntity::Member >::size_type n = 0; for (const unoidl::PlainStructTypeEntity::Member& member : entity_->getDirectMembers()) { - if (types.insert( - std::map< OUString, sal_uInt32 >::value_type( - member.type, static_cast< sal_uInt32 >(types.size()))). + if (types.emplace( + member.type, static_cast< sal_uInt32 >(types.size())). second) { dumpCppuGetType(out, member.type, &name_); // For typedefs, use the resolved type name, as there will be no @@ -2530,9 +2529,8 @@ void PolyStructType::dumpComprehensiveGetCppuType(FileStream & out) size_type n = 0; for (const unoidl::PolymorphicStructTypeTemplateEntity::Member& member : entity_->getMembers()) { if (member.parameterized) { - if (parameters.insert( - std::map< OUString, sal_uInt32 >::value_type( - member.type, static_cast< sal_uInt32 >(parameters.size()))). + if (parameters.emplace( + member.type, static_cast< sal_uInt32 >(parameters.size())). second) { sal_uInt32 k = static_cast< sal_uInt32 >(parameters.size() - 1); out << indent() @@ -2546,9 +2544,7 @@ void PolyStructType::dumpComprehensiveGetCppuType(FileStream & out) << "::rtl::OUString the_pname" << k << "(the_ptype" << k << ".getTypeName());\n"; } - } else if (types.insert( - std::map< OUString, sal_uInt32 >::value_type( - member.type, static_cast< sal_uInt32 >(types.size()))). + } else if (types.emplace(member.type, static_cast< sal_uInt32 >(types.size())). second) { dumpCppuGetType(out, member.type, &name_); // For typedefs, use the resolved type name, as there will be no diff --git a/codemaker/source/cppumaker/dependencies.cxx b/codemaker/source/cppumaker/dependencies.cxx index 99da99fdf7a4..314e0213fec0 100644 --- a/codemaker/source/cppumaker/dependencies.cxx +++ b/codemaker/source/cppumaker/dependencies.cxx @@ -282,8 +282,7 @@ void Dependencies::insert(OUString const & name, Kind kind) { case UnoType::Sort::Typedef: { std::pair< Map::iterator, bool > i( - m_map.insert( - Map::value_type(n, kind))); + m_map.emplace(n, kind)); if (!i.second && kind == KIND_BASE) { assert(i.first->second != KIND_EXCEPTION); i.first->second = KIND_BASE; diff --git a/codemaker/source/cppumaker/includes.cxx b/codemaker/source/cppumaker/includes.cxx index 7ab37166ec61..2a57b1332395 100644 --- a/codemaker/source/cppumaker/includes.cxx +++ b/codemaker/source/cppumaker/includes.cxx @@ -111,8 +111,7 @@ void Includes::add(OString const & entityName) { case codemaker::UnoType::Sort::Exception: case codemaker::UnoType::Sort::Interface: case codemaker::UnoType::Sort::Typedef: - m_map.insert( - Dependencies::Map::value_type(n, Dependencies::KIND_NORMAL)); + m_map.emplace(n, Dependencies::KIND_NORMAL); break; default: throw CannotDumpException( |