forked from lix-project/lix
replaceEnv(): Pass newEnv by reference
This commit is contained in:
parent
212623195c
commit
28309352d9
|
@ -71,14 +71,12 @@ void clearEnv()
|
||||||
unsetenv(name.first.c_str());
|
unsetenv(name.first.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void replaceEnv(std::map<std::string, std::string> newEnv)
|
void replaceEnv(const std::map<std::string, std::string> & newEnv)
|
||||||
{
|
{
|
||||||
clearEnv();
|
clearEnv();
|
||||||
for (auto newEnvVar : newEnv)
|
for (auto & newEnvVar : newEnv)
|
||||||
{
|
|
||||||
setenv(newEnvVar.first.c_str(), newEnvVar.second.c_str(), 1);
|
setenv(newEnvVar.first.c_str(), newEnvVar.second.c_str(), 1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Path absPath(Path path, std::optional<PathView> dir, bool resolveSymlinks)
|
Path absPath(Path path, std::optional<PathView> dir, bool resolveSymlinks)
|
||||||
|
|
Loading…
Reference in a new issue