[Lldb-commits] [lldb] 7ad30f4 - [lldb/Utility] Use emplace_back instead of push_back (NFC)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 2 15:55:13 PST 2020


Author: Jonas Devlieghere
Date: 2020-03-02T15:54:00-08:00
New Revision: 7ad30f4249cf70983d9f7e921445f7af9e158d38

URL: https://github.com/llvm/llvm-project/commit/7ad30f4249cf70983d9f7e921445f7af9e158d38
DIFF: https://github.com/llvm/llvm-project/commit/7ad30f4249cf70983d9f7e921445f7af9e158d38.diff

LOG: [lldb/Utility] Use emplace_back instead of push_back (NFC)

Use emplace_back to allow for in-place construction of the
BroadcastEventSpec instead of copying it.

Added: 
    

Modified: 
    lldb/source/Utility/Broadcaster.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Utility/Broadcaster.cpp b/lldb/source/Utility/Broadcaster.cpp
index 90f91b4f89cf..342548c0b0e6 100644
--- a/lldb/source/Utility/Broadcaster.cpp
+++ b/lldb/source/Utility/Broadcaster.cpp
@@ -373,8 +373,8 @@ bool BroadcasterManager::UnregisterListenerForEvents(
 
     if (event_bits_to_remove != iter_event_bits) {
       uint32_t new_event_bits = iter_event_bits & ~event_bits_to_remove;
-      to_be_readded.push_back(
-          BroadcastEventSpec(event_spec.GetBroadcasterClass(), new_event_bits));
+      to_be_readded.emplace_back(event_spec.GetBroadcasterClass(),
+                                 new_event_bits);
     }
     m_event_map.erase(iter);
   }


        


More information about the lldb-commits mailing list