mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Minor fix to forEach on Yul AST nodes.
This commit is contained in:
parent
d6cb42c9dd
commit
b4f98b41bc
@ -111,8 +111,7 @@ template <
|
|||||||
>
|
>
|
||||||
struct ForEach: Base
|
struct ForEach: Base
|
||||||
{
|
{
|
||||||
template<typename Callable>
|
ForEach(Visitor& _visitor): visitor(_visitor) {}
|
||||||
ForEach(Callable&& _visitor): visitor(std::forward<Callable>(_visitor)) {}
|
|
||||||
|
|
||||||
using Base::operator();
|
using Base::operator();
|
||||||
void operator()(Node& _node) override
|
void operator()(Node& _node) override
|
||||||
@ -121,7 +120,7 @@ struct ForEach: Base
|
|||||||
Base::operator()(_node);
|
Base::operator()(_node);
|
||||||
}
|
}
|
||||||
|
|
||||||
Visitor visitor;
|
Visitor& visitor;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,7 +129,7 @@ struct ForEach: Base
|
|||||||
template<typename Node, typename Entry, typename Visitor>
|
template<typename Node, typename Entry, typename Visitor>
|
||||||
void forEach(Entry&& _entry, Visitor&& _visitor)
|
void forEach(Entry&& _entry, Visitor&& _visitor)
|
||||||
{
|
{
|
||||||
detail::ForEach<Node, std::decay_t<Visitor>>{std::forward<Visitor>(_visitor)}(std::forward<Entry>(_entry));
|
detail::ForEach<Node, Visitor&>{_visitor}(_entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user