1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-16 07:22:43 +01:00

Use StringMap instead of std::map<std::string, std::string> throughout the codebase

This commit is contained in:
Sergei Zimmerman 2025-05-19 20:33:28 +00:00
parent 8c10104e9e
commit 8ee513379a
No known key found for this signature in database
GPG key ID: A9B0B557CA632325
26 changed files with 37 additions and 37 deletions

View file

@ -21,9 +21,9 @@ std::optional<std::string> getEnvNonEmpty(const std::string & key)
return value;
}
std::map<std::string, std::string> getEnv()
StringMap getEnv()
{
std::map<std::string, std::string> env;
StringMap env;
for (size_t i = 0; environ[i]; ++i) {
auto s = environ[i];
auto eq = strchr(s, '=');
@ -41,7 +41,7 @@ void clearEnv()
unsetenv(name.first.c_str());
}
void replaceEnv(const std::map<std::string, std::string> & newEnv)
void replaceEnv(const StringMap & newEnv)
{
clearEnv();
for (auto & newEnvVar : newEnv)