From c95d7ec886986ac41c4865f28d9e795e71129d83 Mon Sep 17 00:00:00 2001 From: VaclavT Date: Wed, 14 Apr 2021 07:55:33 +0200 Subject: [PATCH] pass as reference --- Readme.md | 1 - ml.cpp | 2 +- ml.h | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Readme.md b/Readme.md index d39f20b..3dfecbf 100644 --- a/Readme.md +++ b/Readme.md @@ -37,7 +37,6 @@ - get-env, set-env; set-env cannot be implemented in stdlib.lsp, because popen is in fact subshell - format (sprintf) - setq -- mapcar (funcall, apply) - syntax highlighting do VS Code - add hash datatype diff --git a/ml.cpp b/ml.cpp index 565b289..3c2294d 100644 --- a/ml.cpp +++ b/ml.cpp @@ -1768,7 +1768,7 @@ void load_std_lib(MlEnvironment &env) { } // Does this environment, or its parent environment, have a variable? -bool MlEnvironment::has(std::string name) const { +bool MlEnvironment::has(const std::string &name) const { // Find the value in the map std::map::const_iterator itr = defs.find(name); if (itr != defs.end()) diff --git a/ml.h b/ml.h index 257aa5a..f5e5cd0 100644 --- a/ml.h +++ b/ml.h @@ -34,7 +34,7 @@ public: // have this atom in scope? // This is only used to determine which atoms to capture when // creating a lambda function. - bool has(std::string name) const; + bool has(const std::string &name) const; // Get the value associated with this name in this scope MlValue get(const std::string &name) const;