mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
tls: refactor tls_wrap.cc
Store the result of excetuting the function in variable. Instead of excetuting it for multiple times. PR-URL: https://github.com/nodejs/node/pull/30303 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
1 parent
ab5bca379f
commit
ae5aa3ee83
1 file changed
+4
-5
+4
-5
@@ -1141,12 +1141,11 @@ void TLSWrap::Initialize(Local<Object> target,
|
||||
env->SetProtoMethod(t, "getServername", GetServername);
|
||||
env->SetProtoMethod(t, "setServername", SetServername);
|
||||
|
||||
env->set_tls_wrap_constructor_function(
|
||||
t->GetFunction(env->context()).ToLocalChecked());
|
||||
Local<Function> fn = t->GetFunction(env->context()).ToLocalChecked();
|
||||
|
||||
target->Set(env->context(),
|
||||
tlsWrapString,
|
||||
t->GetFunction(env->context()).ToLocalChecked()).Check();
|
||||
env->set_tls_wrap_constructor_function(fn);
|
||||
|
||||
target->Set(env->context(), tlsWrapString, fn).Check();
|
||||
}
|
||||
|
||||
} // namespace node
|
||||
|
||||
Reference in new issue
Block a user