From 14707e3eb8d0a53d2398fdb94e5a014a86d554be Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 20 Oct 2016 22:36:17 +0200 Subject: [PATCH] src: remove superfluous env_string string It's only used once at startup in a single place so create the string in place instead of caching it for the lifetime of the isolate. PR-URL: https://github.com/nodejs/node/pull/9213 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- src/env.h | 1 - src/node.cc | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/env.h b/src/env.h index a10e699e0a73c3..bb4dab070606a8 100644 --- a/src/env.h +++ b/src/env.h @@ -94,7 +94,6 @@ namespace node { V(encoding_string, "encoding") \ V(enter_string, "enter") \ V(env_pairs_string, "envPairs") \ - V(env_string, "env") \ V(errno_string, "errno") \ V(error_string, "error") \ V(events_string, "_events") \ diff --git a/src/node.cc b/src/node.cc index 65795653c1a6d0..958560b2dd951a 100644 --- a/src/node.cc +++ b/src/node.cc @@ -3280,7 +3280,7 @@ void SetupProcessObject(Environment* env, Local process_env = process_env_template->NewInstance(env->context()).ToLocalChecked(); - process->Set(env->env_string(), process_env); + process->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "env"), process_env); READONLY_PROPERTY(process, "pid", Integer::New(env->isolate(), getpid())); READONLY_PROPERTY(process, "features", GetFeatures(env));