src: remove unnecessary temporary creation

PR-URL: https://github.com/nodejs/node/pull/48734
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
This commit is contained in:
Jason 2023-07-20 17:20:15 +08:00 committed by GitHub
parent c301404105
commit ce73e887a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,8 +26,8 @@ bool CleanupQueue::empty() const {
}
void CleanupQueue::Add(Callback cb, void* arg) {
auto insertion_info = cleanup_hooks_.emplace(
CleanupHookCallback{cb, arg, cleanup_hook_counter_++});
auto insertion_info =
cleanup_hooks_.emplace(cb, arg, cleanup_hook_counter_++);
// Make sure there was no existing element with these values.
CHECK_EQ(insertion_info.second, true);
}