From ef0c183ed70260cb7157db056bc162051541edaf Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 21 Mar 2019 20:43:24 +1100 Subject: [PATCH] Do not copy environment strings, just refer to them --- src/env_vars.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/env_vars.cc b/src/env_vars.cc index 8b293ff2..1672cc85 100644 --- a/src/env_vars.cc +++ b/src/env_vars.cc @@ -16,7 +16,8 @@ EnvVarMap get_env_vars() const char* value = name; while (*value != 0 and *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; }