Skip to content

Commit

Permalink
src: remove unnecessary HandleScopes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bnoordhuis authored and rvagg committed Oct 18, 2016
1 parent a1bf43c commit 784b808
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1776,8 +1776,6 @@ template <class Base>
void SSLWrap<Base>::SetOCSPResponse(
const v8::FunctionCallbackInfo<v8::Value>& args) {
#ifdef NODE__HAVE_TLSEXT_STATUS_CB
HandleScope scope(args.GetIsolate());

Base* w = Unwrap<Base>(args.Holder());
if (args.Length() < 1 || !Buffer::HasInstance(args[0]))
return w->env()->ThrowTypeError("Must give a Buffer as first argument");
Expand All @@ -1791,8 +1789,6 @@ template <class Base>
void SSLWrap<Base>::RequestOCSP(
const v8::FunctionCallbackInfo<v8::Value>& args) {
#ifdef NODE__HAVE_TLSEXT_STATUS_CB
HandleScope scope(args.GetIsolate());

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

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

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

0 comments on commit 784b808

Please sign in to comment.