Skip to content

Commit

Permalink
Use stack emplace rather than push
Browse files Browse the repository at this point in the history
This avoids creating a temporary v8::Global
  • Loading branch information
Qard committed Dec 19, 2019
1 parent d08abdb commit 6b12f77
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/env-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,8 @@ inline AsyncHooks::DefaultTriggerAsyncIdScope ::~DefaultTriggerAsyncIdScope() {
}

inline void AsyncHooks::push_execution_async_resource(
v8::Local<v8::Value> execution_async_resource) {
execution_async_resources_.push(v8::Global<v8::Value>(
env()->isolate(), execution_async_resource));
v8::Local<v8::Value> resource) {
execution_async_resources_.emplace(env()->isolate(), resource);
}

inline void AsyncHooks::pop_execution_async_resource() {
Expand Down

0 comments on commit 6b12f77

Please sign in to comment.