Make parseOperation parameter const
Cppcheck gives a error when it scans this file.
src/expression.cpp:25:54: style: Parameter 'op' can be declared as reference to const [constParameter]
std::optional<Operation> parseOperation(std::string& op)
Signed-off-by: John Edward Broadbent <jebr@google.com>
Change-Id: Ib06e9ac9a98d7542838746c9a34ae4f74673504f
diff --git a/include/expression.hpp b/include/expression.hpp
index 00b9cc0..6677b2d 100644
--- a/include/expression.hpp
+++ b/include/expression.hpp
@@ -32,7 +32,7 @@
modulo,
};
-std::optional<Operation> parseOperation(std::string& op);
+std::optional<Operation> parseOperation(const std::string& op);
int evaluate(int a, Operation op, int b);
int evaluate(int substitute, std::vector<std::string>::iterator curr,
std::vector<std::string>::iterator& end);