Skip to content

Commit b1dc2d4

Browse files
bnoordhuisMylesBorins
authored andcommitted
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 <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 2435af9 commit b1dc2d4

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
@@ -94,7 +94,6 @@ namespace node {
9494
V(encoding_string, "encoding") \
9595
V(enter_string, "enter") \
9696
V(env_pairs_string, "envPairs") \
97-
V(env_string, "env") \
9897
V(errno_string, "errno") \
9998
V(error_string, "error") \
10099
V(events_string, "_events") \

src/node.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -3280,7 +3280,7 @@ void SetupProcessObject(Environment* env,
32803280

32813281
Local<Object> process_env =
32823282
process_env_template->NewInstance(env->context()).ToLocalChecked();
3283-
process->Set(env->env_string(), process_env);
3283+
process->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "env"), process_env);
32843284

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

0 commit comments

Comments
 (0)