MultiUseYulFunctionCollector::requestedFunctions(): Refactor the loop to use destructuring

This commit is contained in:
Mathias Baumann 2020-11-18 18:24:33 +01:00 committed by Kamil Śliwak
parent e75e3fc2e3
commit 8bacf03ffe

View File

@ -32,11 +32,11 @@ using namespace solidity::frontend;
string MultiUseYulFunctionCollector::requestedFunctions() string MultiUseYulFunctionCollector::requestedFunctions()
{ {
string result; string result;
for (auto const& f: m_requestedFunctions) for (auto const& [name, code]: m_requestedFunctions)
{ {
solAssert(f.second != "<<STUB<<", ""); solAssert(code != "<<STUB<<", "");
// std::map guarantees ascending order when iterating through its keys. // std::map guarantees ascending order when iterating through its keys.
result += f.second; result += code;
} }
m_requestedFunctions.clear(); m_requestedFunctions.clear();
return result; return result;