From 08e12c78098f3435ad44a97bd35a23e4e0bba39d 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 c040c1a753324f..fe49ac0c876a47 100644 --- a/src/env.h +++ b/src/env.h @@ -93,7 +93,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 9f8eac23342d7c..d02ecf1a1cdd6c 100644 --- a/src/node.cc +++ b/src/node.cc @@ -3157,7 +3157,7 @@ void SetupProcessObject(Environment* env, env->as_external()); 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));