fixed: incorrect erasing of env vars (#3622)

This commit is contained in:
Klaim (Joël Lamotte) 2024-11-20 18:09:27 +01:00 committed by GitHub
parent c0ce48bebe
commit d4de99bfef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 4 deletions

View File

@ -554,10 +554,14 @@ namespace mamba
auto conda_environment_env_vars = get_environment_vars(prefix);
// TODO check with conda if that's really what's supposed to happen ...
std::remove_if(
conda_environment_env_vars.begin(),
conda_environment_env_vars.end(),
[](auto& el) { return el.second == CONDA_ENV_VARS_UNSET_VAR; }
// TODO: C++20 replace by `std::erase_if`
conda_environment_env_vars.erase(
std::remove_if(
conda_environment_env_vars.begin(),
conda_environment_env_vars.end(),
[](auto& el) { return el.second == CONDA_ENV_VARS_UNSET_VAR; }
),
conda_environment_env_vars.end()
);
std::vector<std::string> clobbering_env_vars;