refactor: use std::optional in MicrotasksScope (#43621)
avoid an unnecessary heap allocation/free
This commit is contained in:
parent
e2fe8f50e2
commit
2844e346b9
2 changed files with 3 additions and 4 deletions
|
@ -16,8 +16,7 @@ MicrotasksScope::MicrotasksScope(v8::Isolate* isolate,
|
|||
if (!ignore_browser_checkpoint)
|
||||
v8::MicrotasksScope::PerformCheckpoint(isolate);
|
||||
} else {
|
||||
v8_microtasks_scope_ = std::make_unique<v8::MicrotasksScope>(
|
||||
isolate, microtask_queue, scope_type);
|
||||
v8_microtasks_scope_.emplace(isolate, microtask_queue, scope_type);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue