Apply modernize-use-emplace.

This commit is contained in:
Alexander Arlt
2020-04-02 17:35:48 -05:00
parent 82f57f0465
commit 90bb1d8a7c
14 changed files with 33 additions and 49 deletions
+1 -1
View File
@@ -495,7 +495,7 @@ ASTPointer<UserDefinedTypeName> ASTJsonImporter::createUserDefinedTypeName(Json:
string nameString = member(_node, "name").asString();
boost::algorithm::split(strs, nameString, boost::is_any_of("."));
for (string s: strs)
namePath.push_back(ASTString(s));
namePath.emplace_back(s);
return createASTNode<UserDefinedTypeName>(
_node,
namePath
+2 -2
View File
@@ -843,7 +843,7 @@ string ABIFunctions::abiEncodingFunctionStruct(
if (dynamicMember)
solAssert(dynamic, "");
members.push_back({});
members.emplace_back();
members.back()["preprocess"] = "";
switch (_from.location())
@@ -1336,7 +1336,7 @@ string ABIFunctions::abiDecodingFunctionStruct(StructType const& _type, bool _fr
memberTempl("memoryOffset", toCompactHexWithPrefix(_type.memoryOffsetOfMember(member.name)));
memberTempl("abiDecode", abiDecodingFunction(*member.type, _fromMemory, false));
members.push_back({});
members.emplace_back();
members.back()["decode"] = memberTempl.render();
members.back()["memberName"] = member.name;
headPos += decodingType->calldataHeadSize();
+1 -1
View File
@@ -339,7 +339,7 @@ string IRGenerator::dispatchRoutine(ContractDefinition const& _contract)
vector<map<string, string>> functions;
for (auto const& function: _contract.interfaceFunctions())
{
functions.push_back({});
functions.emplace_back();
map<string, string>& templ = functions.back();
templ["functionSelector"] = "0x" + function.first.hex();
FunctionTypePointer const& type = function.second;
+1 -1
View File
@@ -232,7 +232,7 @@ void EncodingContext::pushSolver()
if (m_accumulateAssertions)
m_assertions.push_back(assertions());
else
m_assertions.push_back(smt::Expression(true));
m_assertions.emplace_back(true);
}
void EncodingContext::popSolver()
+1 -1
View File
@@ -200,7 +200,7 @@ bool isArtifactRequested(Json::Value const& _outputSelection, string const& _fil
/// for Contract-level targets try both contract name and wildcard
vector<string> contracts{ _contract };
if (!_contract.empty())
contracts.push_back("*");
contracts.emplace_back("*");
for (auto const& contract: contracts)
if (
_outputSelection[file].isMember(contract) &&