From b4f98b41bc9424be1d2cb659deaa9255b51cf3f2 Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Fri, 5 Nov 2021 13:03:13 +0100 Subject: [PATCH] Minor fix to forEach on Yul AST nodes. --- libyul/optimiser/ASTWalker.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libyul/optimiser/ASTWalker.h b/libyul/optimiser/ASTWalker.h index cd98a90ca..b937f7eae 100644 --- a/libyul/optimiser/ASTWalker.h +++ b/libyul/optimiser/ASTWalker.h @@ -111,8 +111,7 @@ template < > struct ForEach: Base { - template - ForEach(Callable&& _visitor): visitor(std::forward(_visitor)) {} + ForEach(Visitor& _visitor): visitor(_visitor) {} using Base::operator(); void operator()(Node& _node) override @@ -121,7 +120,7 @@ struct ForEach: Base Base::operator()(_node); } - Visitor visitor; + Visitor& visitor; }; } @@ -130,7 +129,7 @@ struct ForEach: Base template void forEach(Entry&& _entry, Visitor&& _visitor) { - detail::ForEach>{std::forward(_visitor)}(std::forward(_entry)); + detail::ForEach{_visitor}(_entry); } }