do not reserve lamdas vector

This commit is contained in:
vaclavt
2022-03-06 19:59:38 +01:00
parent c27395aca5
commit 084a94ab2b

1
ml.cpp
View File

@@ -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))