mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Use reference for so we have to type less
This commit is contained in:
parent
3ccf73b3eb
commit
db3bea7b56
@ -83,9 +83,11 @@ void StructuralSimplifier::simplify(std::vector<yul::Statement>& _statements)
|
||||
return {};
|
||||
},
|
||||
[&](Switch& _switchStmt) -> OptionalStatements {
|
||||
if (_switchStmt.cases.size() == 1)
|
||||
auto& cases = _switchStmt.cases;
|
||||
|
||||
if (cases.size() == 1)
|
||||
{
|
||||
auto& switchCase = _switchStmt.cases.front();
|
||||
auto& switchCase = cases.front();
|
||||
auto loc = locationOf(*_switchStmt.expression);
|
||||
if (switchCase.value)
|
||||
{
|
||||
@ -112,7 +114,7 @@ void StructuralSimplifier::simplify(std::vector<yul::Statement>& _statements)
|
||||
Block* matchingCaseBlock = nullptr;
|
||||
Case* defaultCase = nullptr;
|
||||
|
||||
for (auto& _case: _switchStmt.cases)
|
||||
for (auto& _case: cases)
|
||||
{
|
||||
if (_case.value && valueOfLiteral(*_case.value) == constExprVal)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user