File tree 1 file changed +2
-8
lines changed
lldb/include/lldb/Breakpoint 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 {
38
38
typename StopPointSite::SiteID Add (const StopPointSiteSP &site_sp) {
39
39
lldb::addr_t site_load_addr = site_sp->GetLoadAddress ();
40
40
std::lock_guard<std::recursive_mutex> guard (m_mutex);
41
- typename collection::iterator iter = m_site_list.find (site_load_addr);
42
-
43
41
// Add site to the list. However, if the element already exists in
44
42
// 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;
51
45
}
52
46
53
47
// / Standard Dump routine, doesn't do anything at present.
You can’t perform that action at this time.
0 commit comments