From cf699a02cae81e09d694a18f857eb07503b6e66c Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sun, 24 Feb 2019 21:58:44 +0100 Subject: 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(-) (limited to 'src/node_perf.cc') diff --git a/src/node_perf.cc b/src/node_perf.cc index 908c76c211..e16be29a87 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; -- cgit v1.2.3