[lldb/Utility] Use emplace_back instead of push_back (NFC)
authorJonas Devlieghere <jonas@devlieghere.com>
Mon, 2 Mar 2020 23:53:59 +0000 (15:53 -0800)
committerJonas Devlieghere <jonas@devlieghere.com>
Mon, 2 Mar 2020 23:54:00 +0000 (15:54 -0800)
Use emplace_back to allow for in-place construction of the
BroadcastEventSpec instead of copying it.

lldb/source/Utility/Broadcaster.cpp

index 90f91b4..342548c 100644 (file)
@@ -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);
   }