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 /formula | |
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 'formula')
-rw-r--r-- | formula/source/core/api/FormulaCompiler.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx index 0377fd761df3..716666513441 100644 --- a/formula/source/core/api/FormulaCompiler.cxx +++ b/formula/source/core/api/FormulaCompiler.cxx @@ -372,11 +372,11 @@ void FormulaCompiler::OpCodeMap::putExternal( const OUString & rSymbol, const OU // map to different symbols, the first pair wins. Same symbol of course may // not map to different AddIns, again the first pair wins and also the // AddIn->symbol mapping is not inserted in other cases. - bool bOk = maExternalHashMap.insert( ExternalHashMap::value_type( rSymbol, rAddIn)).second; + bool bOk = maExternalHashMap.emplace(rSymbol, rAddIn).second; SAL_WARN_IF( !bOk, "formula.core", "OpCodeMap::putExternal: symbol not inserted, " << rSymbol << " -> " << rAddIn); if (bOk) { - bOk = maReverseExternalHashMap.insert( ExternalHashMap::value_type( rAddIn, rSymbol)).second; + bOk = maReverseExternalHashMap.emplace(rAddIn, rSymbol).second; // Failed insertion of the AddIn is ok for different symbols mapping to // the same AddIn. Make this INFO only. SAL_INFO_IF( !bOk, "formula.core", "OpCodeMap::putExternal: AddIn not inserted, " << rAddIn << " -> " << rSymbol); @@ -385,9 +385,9 @@ void FormulaCompiler::OpCodeMap::putExternal( const OUString & rSymbol, const OU void FormulaCompiler::OpCodeMap::putExternalSoftly( const OUString & rSymbol, const OUString & rAddIn ) { - bool bOk = maReverseExternalHashMap.insert( ExternalHashMap::value_type( rAddIn, rSymbol)).second; + bool bOk = maReverseExternalHashMap.emplace(rAddIn, rSymbol).second; if (bOk) - maExternalHashMap.insert( ExternalHashMap::value_type( rSymbol, rAddIn)); + maExternalHashMap.emplace(rSymbol, rAddIn); } uno::Sequence< sheet::FormulaToken > FormulaCompiler::OpCodeMap::createSequenceOfFormulaTokens( @@ -697,7 +697,7 @@ void FormulaCompiler::OpCodeMap::putOpCode( const OUString & rStr, const OpCode if (bPutOp) mpTable[eOp] = rStr; OUString aUpper( pCharClass ? pCharClass->uppercase( rStr) : rStr.toAsciiUpperCase()); - maHashMap.insert( OpCodeHashMap::value_type( aUpper, eOp)); + maHashMap.emplace(aUpper, eOp); } else { @@ -1076,11 +1076,11 @@ void FormulaCompiler::OpCodeMap::putCopyOpCode( const OUString& rSymbol, OpCode "OpCodeMap::putCopyOpCode: NOT replacing OpCode " << static_cast<sal_uInt16>(eOp) << " '" << mpTable[eOp] << "' with empty name!"); if (!mpTable[eOp].isEmpty() && rSymbol.isEmpty()) - maHashMap.insert( OpCodeHashMap::value_type( mpTable[eOp], eOp)); + maHashMap.emplace(mpTable[eOp], eOp); else { mpTable[eOp] = rSymbol; - maHashMap.insert( OpCodeHashMap::value_type( rSymbol, eOp)); + maHashMap.emplace(rSymbol, eOp); } } |