Skip to content

Commit e8dbd09

Browse files
oyydrvagg
authored andcommitted
src: use "constants" string instead of creating new one
Using the same "constants" string in c++. PR-URL: #23894 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Сковорода Никита Андреевич <[email protected]>
1 parent fa12532 commit e8dbd09

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/node_http2.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -3289,7 +3289,7 @@ HTTP_STATUS_CODES(V)
32893289
env->SetMethod(target, "packSettings", PackSettings);
32903290

32913291
target->Set(context,
3292-
FIXED_ONE_BYTE_STRING(isolate, "constants"),
3292+
env->constants_string(),
32933293
constants).FromJust();
32943294
target->Set(context,
32953295
FIXED_ONE_BYTE_STRING(isolate, "nameForErrorCode"),

src/pipe_wrap.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void PipeWrap::Initialize(Local<Object> target,
117117
NODE_DEFINE_CONSTANT(constants, SERVER);
118118
NODE_DEFINE_CONSTANT(constants, IPC);
119119
target->Set(context,
120-
FIXED_ONE_BYTE_STRING(env->isolate(), "constants"),
120+
env->constants_string(),
121121
constants).FromJust();
122122
}
123123

src/tcp_wrap.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ void TCPWrap::Initialize(Local<Object> target,
132132
NODE_DEFINE_CONSTANT(constants, SOCKET);
133133
NODE_DEFINE_CONSTANT(constants, SERVER);
134134
target->Set(context,
135-
FIXED_ONE_BYTE_STRING(env->isolate(), "constants"),
135+
env->constants_string(),
136136
constants).FromJust();
137137
}
138138

0 commit comments

Comments
 (0)