Skip to content

Commit 784b808

Browse files
bnoordhuisrvagg
authored andcommitted
src: remove unnecessary HandleScopes
API function callbacks run inside an implicit HandleScope. We don't need to explicitly create one and in fact introduce some unnecessary overhead when we do. PR-URL: #7711 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
1 parent a1bf43c commit 784b808

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/node_crypto.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1776,8 +1776,6 @@ template <class Base>
17761776
void SSLWrap<Base>::SetOCSPResponse(
17771777
const v8::FunctionCallbackInfo<v8::Value>& args) {
17781778
#ifdef NODE__HAVE_TLSEXT_STATUS_CB
1779-
HandleScope scope(args.GetIsolate());
1780-
17811779
Base* w = Unwrap<Base>(args.Holder());
17821780
if (args.Length() < 1 || !Buffer::HasInstance(args[0]))
17831781
return w->env()->ThrowTypeError("Must give a Buffer as first argument");
@@ -1791,8 +1789,6 @@ template <class Base>
17911789
void SSLWrap<Base>::RequestOCSP(
17921790
const v8::FunctionCallbackInfo<v8::Value>& args) {
17931791
#ifdef NODE__HAVE_TLSEXT_STATUS_CB
1794-
HandleScope scope(args.GetIsolate());
1795-
17961792
Base* w = Unwrap<Base>(args.Holder());
17971793

17981794
SSL_set_tlsext_status_type(w->ssl_, TLSEXT_STATUSTYPE_ocsp);
@@ -1804,7 +1800,6 @@ void SSLWrap<Base>::RequestOCSP(
18041800
template <class Base>
18051801
void SSLWrap<Base>::SetMaxSendFragment(
18061802
const v8::FunctionCallbackInfo<v8::Value>& args) {
1807-
HandleScope scope(args.GetIsolate());
18081803
CHECK(args.Length() >= 1 && args[0]->IsNumber());
18091804

18101805
Base* w = Unwrap<Base>(args.Holder());

0 commit comments

Comments
 (0)