Skip to content

Commit 63c47e7

Browse files
committedOct 25, 2016
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: #9213 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 921d2b0 commit 63c47e7

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed
 

‎src/env.h

-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ namespace node {
9393
V(encoding_string, "encoding") \
9494
V(enter_string, "enter") \
9595
V(env_pairs_string, "envPairs") \
96-
V(env_string, "env") \
9796
V(errno_string, "errno") \
9897
V(error_string, "error") \
9998
V(events_string, "_events") \

‎src/node.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -3157,7 +3157,7 @@ void SetupProcessObject(Environment* env,
31573157
env->as_external());
31583158
Local<Object> process_env =
31593159
process_env_template->NewInstance(env->context()).ToLocalChecked();
3160-
process->Set(env->env_string(), process_env);
3160+
process->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "env"), process_env);
31613161

31623162
READONLY_PROPERTY(process, "pid", Integer::New(env->isolate(), getpid()));
31633163
READONLY_PROPERTY(process, "features", GetFeatures(env));

0 commit comments

Comments
 (0)
Please sign in to comment.