From 622048d5392a7350b92919a5b3b2786df3039867 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sun, 24 Feb 2019 21:58:44 +0100 Subject: [PATCH] src: prefer to get `Environment` from `Context` We explicitly store the context anyway, and can skip the extra steps introduced in `Environment::GetCurrent()`. PR-URL: https://github.com/nodejs/node/pull/26376 Reviewed-By: Gireesh Punathil Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- src/node_perf.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/node_perf.cc b/src/node_perf.cc index 908c76c2110d26..e16be29a872f80 100644 --- a/src/node_perf.cc +++ b/src/node_perf.cc @@ -333,10 +333,9 @@ inline Local GetName(Local fn) { // execution. void TimerFunctionCall(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); - HandleScope scope(isolate); - Environment* env = Environment::GetCurrent(isolate); + Local context = isolate->GetCurrentContext(); + Environment* env = Environment::GetCurrent(context); CHECK_NOT_NULL(env); - Local context = env->context(); Local fn = args.Data().As(); size_t count = args.Length(); size_t idx;