Skip to content

Commit 622048d

Browse files
addaleaxBridgeAR
authored andcommitted
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: #26376 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 716ec00 commit 622048d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/node_perf.cc

+2-3
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,9 @@ inline Local<Value> GetName(Local<Function> fn) {
333333
// execution.
334334
void TimerFunctionCall(const FunctionCallbackInfo<Value>& args) {
335335
Isolate* isolate = args.GetIsolate();
336-
HandleScope scope(isolate);
337-
Environment* env = Environment::GetCurrent(isolate);
336+
Local<Context> context = isolate->GetCurrentContext();
337+
Environment* env = Environment::GetCurrent(context);
338338
CHECK_NOT_NULL(env);
339-
Local<Context> context = env->context();
340339
Local<Function> fn = args.Data().As<Function>();
341340
size_t count = args.Length();
342341
size_t idx;

0 commit comments

Comments
 (0)