mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Apply modernize-use-emplace.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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) &&
|
||||
|
||||
Reference in New Issue
Block a user