Skip to content

Commit

Permalink
src: remove superfluous env_string string
Browse files Browse the repository at this point in the history
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: #9213
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
bnoordhuis authored and gibfahn committed Jun 20, 2017
1 parent 026b74e commit 14707e3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion src/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -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") \
Expand Down
2 changes: 1 addition & 1 deletion src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3280,7 +3280,7 @@ void SetupProcessObject(Environment* env,

Local<Object> 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));
Expand Down

0 comments on commit 14707e3

Please sign in to comment.