[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:
Konstantin Käfer
2019-01-30 16:50:38 +01:00
parent ce37879231
commit 8faee25546

View File

@@ -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);