Expression: evaluate adjusts the end iterator to the end
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I1e3f3a0acedcaf9feb6d888e3ac31bf5bb542a9d
diff --git a/src/Expression.cpp b/src/Expression.cpp
index b3f21d9..34be337 100644
--- a/src/Expression.cpp
+++ b/src/Expression.cpp
@@ -78,8 +78,8 @@
}
}
-int evaluate(int substitute, std::vector<std::string>::iterator& curr,
- std::vector<std::string>::iterator&& end)
+int evaluate(int substitute, std::vector<std::string>::iterator curr,
+ std::vector<std::string>::iterator& end)
{
bool isOperator = true;
std::optional<Operation> next = Operation::addition;
@@ -111,6 +111,7 @@
isOperator = !isOperator;
}
+ end = curr;
return substitute;
}
} // namespace expression