Do not copy environment strings, just refer to them

This commit is contained in:
Maxime Coste 2019-03-21 20:43:24 +11:00
parent 31d67f51dd
commit ef0c183ed7

View File

@ -16,7 +16,8 @@ EnvVarMap get_env_vars()
const char* value = name; const char* value = name;
while (*value != 0 and *value != '=') while (*value != 0 and *value != '=')
++value; ++value;
env_vars.insert({{name, value}, (*value == '=') ? value+1 : String{}}); env_vars.insert({String{String::NoCopy{}, {name, value}},
(*value == '=') ? String{String::NoCopy{}, value+1} : String{}});
} }
return env_vars; return env_vars;
} }