File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
lldb/include/lldb/Breakpoint Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -38,16 +38,10 @@ template <typename StopPointSite> class StopPointSiteList {
3838 typename StopPointSite::SiteID Add (const StopPointSiteSP &site_sp) {
3939 lldb::addr_t site_load_addr = site_sp->GetLoadAddress ();
4040 std::lock_guard<std::recursive_mutex> guard (m_mutex);
41- typename collection::iterator iter = m_site_list.find (site_load_addr);
42-
4341 // Add site to the list. However, if the element already exists in
4442 // the list, then we don't add it, and return InvalidSiteID.
45- if (iter == m_site_list.end ()) {
46- m_site_list[site_load_addr] = site_sp;
47- return site_sp->GetID ();
48- } else {
49- return UINT32_MAX;
50- }
43+ bool inserted = m_site_list.try_emplace (site_load_addr, site_sp).second ;
44+ return inserted ? site_sp->GetID () : UINT32_MAX;
5145 }
5246
5347 // / Standard Dump routine, doesn't do anything at present.
You can’t perform that action at this time.
0 commit comments