do not reserve lamdas vector
This commit is contained in:
1
ml.cpp
1
ml.cpp
@@ -2289,6 +2289,7 @@ MlValue MlEnvironment::get(const std::string &name) const {
|
||||
// Get vector of executables in this scope
|
||||
std::vector<std::string> MlEnvironment::get_lambdas_list(const std::string &token) const {
|
||||
std::vector<std::string> lambdas{};
|
||||
lambdas.reserve(16);
|
||||
|
||||
for (auto it = defs.begin(); it != defs.end(); it++)
|
||||
if (it->second.get_type_name() == FUNCTION_TYPE && (token.empty() || it->first.find(token) == 0))
|
||||
|
||||
Reference in New Issue
Block a user