[core] change loop variable type to auto
We used `const std::pair<T, std::shared_ptr<Expression>>`, but the actual type is `const std::pair<const T, std::shared_ptr<Expression>>` which resulted in an implicit copy
This commit is contained in:
@@ -11,7 +11,7 @@ namespace expression {
|
||||
template <typename T>
|
||||
void Match<T>::eachChild(const std::function<void(const Expression&)>& visit) const {
|
||||
visit(*input);
|
||||
for (const std::pair<T, std::shared_ptr<Expression>>& branch : branches) {
|
||||
for (const auto& branch : branches) {
|
||||
visit(*branch.second);
|
||||
}
|
||||
visit(*otherwise);
|
||||
|
||||
Reference in New Issue
Block a user