From e84d63c13879a43a4d29c52e9a4e7cb23714e33b Mon Sep 17 00:00:00 2001 From: VaclavT Date: Mon, 22 Feb 2021 01:25:49 +0100 Subject: [PATCH] const & parameter --- ml.cpp | 2 +- ml.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ml.cpp b/ml.cpp index 87a24c3..7c912ff 100644 --- a/ml.cpp +++ b/ml.cpp @@ -644,7 +644,7 @@ std::ostream &operator<<(std::ostream &os, MlEnvironment const &e) { return os << "}"; } -void MlEnvironment::set(std::string name, MlValue value) { +void MlEnvironment::set(const std::string &name, MlValue value) { defs[name] = value; } diff --git a/ml.h b/ml.h index cbf64cf..42ea34d 100644 --- a/ml.h +++ b/ml.h @@ -28,7 +28,7 @@ public: MlValue get(const std::string &name) const; // Set the value associated with this name in this scope - void set(std::string name, MlValue value); + void set(const std::string &name, MlValue value); void combine(MlEnvironment const &other);