From c66a5bbbbc51777f43d8a5aa65923de6ec8ff1c4 Mon Sep 17 00:00:00 2001 From: CGQAQ Date: Tue, 11 Jul 2023 03:30:47 +0000 Subject: [PATCH 1/2] src: remove unnecessary temporary creation --- src/cleanup_queue-inl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cleanup_queue-inl.h b/src/cleanup_queue-inl.h index 5d9a56e6b07956..f0394375808611 100644 --- a/src/cleanup_queue-inl.h +++ b/src/cleanup_queue-inl.h @@ -27,7 +27,7 @@ bool CleanupQueue::empty() const { void CleanupQueue::Add(Callback cb, void* arg) { auto insertion_info = cleanup_hooks_.emplace( - CleanupHookCallback{cb, arg, cleanup_hook_counter_++}); + cb, arg, cleanup_hook_counter_++); // Make sure there was no existing element with these values. CHECK_EQ(insertion_info.second, true); } From 1f788f1902de5536b1110315ae6a30671ce2e2b7 Mon Sep 17 00:00:00 2001 From: CGQAQ Date: Wed, 12 Jul 2023 05:22:54 +0000 Subject: [PATCH 2/2] src: run CLANG_FORMAT_START=$(git merge-base HEAD main) make format-cpp --- src/cleanup_queue-inl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cleanup_queue-inl.h b/src/cleanup_queue-inl.h index f0394375808611..4810e75c64679a 100644 --- a/src/cleanup_queue-inl.h +++ b/src/cleanup_queue-inl.h @@ -26,8 +26,8 @@ bool CleanupQueue::empty() const { } void CleanupQueue::Add(Callback cb, void* arg) { - auto insertion_info = cleanup_hooks_.emplace( - 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); }