diff options
author | Anna Henningsen <anna@addaleax.net> | 2020-05-07 00:36:10 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2020-05-09 06:43:46 +0300 |
commit | fea01c11792cdbeca9a81525ed46a1b83192f802 (patch) | |
tree | 06a12c4f1a4083316b39fb043bca41d0d5b0a9cd /src/env.cc | |
parent | 2c3c9f5a3f6d54230dcc65efacb5b57d0979b462 (diff) |
src: split out callback queue implementation from Environment
This isn’t conceptually tied to anything Node.js-specific at all.
PR-URL: https://github.com/nodejs/node/pull/33272
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'src/env.cc')
-rw-r--r-- | src/env.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/env.cc b/src/env.cc index 3efa5c3b9c9..06e6fe6f793 100644 --- a/src/env.cc +++ b/src/env.cc @@ -729,7 +729,7 @@ void Environment::RunAndClearInterrupts() { } DebugSealHandleScope seal_handle_scope(isolate()); - while (std::unique_ptr<NativeImmediateCallback> head = queue.Shift()) + while (auto head = queue.Shift()) head->Call(this); } } @@ -755,8 +755,7 @@ void Environment::RunAndClearNativeImmediates(bool only_refed) { auto drain_list = [&]() { TryCatchScope try_catch(this); DebugSealHandleScope seal_handle_scope(isolate()); - while (std::unique_ptr<NativeImmediateCallback> head = - native_immediates_.Shift()) { + while (auto head = native_immediates_.Shift()) { if (head->is_refed()) ref_count++; |