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:
parent
8c10104e9e
commit
8ee513379a
26 changed files with 37 additions and 37 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue