const &
This commit is contained in:
4
ml.cpp
4
ml.cpp
@@ -1708,7 +1708,7 @@ bool MlEnvironment::has(std::string name) const {
|
||||
}
|
||||
|
||||
// Get the value associated with this name in this scope
|
||||
MlValue MlEnvironment::get(std::string name) const {
|
||||
MlValue MlEnvironment::get(const std::string& name) const {
|
||||
// Meta operations
|
||||
if (name == "eval") return MlValue("eval", builtin::eval);
|
||||
if (name == "type") return MlValue("type", builtin::get_type_name);
|
||||
@@ -1790,7 +1790,7 @@ MlValue MlEnvironment::get(std::string name) const {
|
||||
|
||||
std::map<std::string, MlValue>::const_iterator itr = defs.find(name);
|
||||
if (itr != defs.end()) return itr->second;
|
||||
else if (parent_scope != NULL) {
|
||||
else if (parent_scope != nullptr) {
|
||||
itr = parent_scope->defs.find(name);
|
||||
if (itr != parent_scope->defs.end()) return itr->second;
|
||||
else return parent_scope->get(name);
|
||||
|
||||
Reference in New Issue
Block a user