From 6b12f77fa484e08b8cbb54c0a7630ca636400369 Mon Sep 17 00:00:00 2001 From: Stephen Belanger Date: Thu, 19 Dec 2019 07:50:08 -0800 Subject: [PATCH] Use stack emplace rather than push This avoids creating a temporary v8::Global --- src/env-inl.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/env-inl.h b/src/env-inl.h index 74a692d5100bf9..76f1ac0fa22a9c 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -207,9 +207,8 @@ inline AsyncHooks::DefaultTriggerAsyncIdScope ::~DefaultTriggerAsyncIdScope() { } inline void AsyncHooks::push_execution_async_resource( - v8::Local execution_async_resource) { - execution_async_resources_.push(v8::Global( - env()->isolate(), execution_async_resource)); + v8::Local resource) { + execution_async_resources_.emplace(env()->isolate(), resource); } inline void AsyncHooks::pop_execution_async_resource() {