[Lldb-commits] [lldb] [lldb] [mostly NFC] Large WP foundation: WatchpointResources (PR #68845)

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 25 15:42:00 PDT 2023


================
@@ -67,18 +67,15 @@ size_t WatchpointResource::GetNumberOfOwners() {
 bool WatchpointResource::OwnersContains(WatchpointSP &wp_sp) {
   std::lock_guard<std::recursive_mutex> guard(m_owners_mutex);
   const auto &it = std::find(m_owners.begin(), m_owners.end(), wp_sp);
-  if (it != m_owners.end())
-    return true;
-  return false;
+  return it != m_owners.end();
 }
 
 bool WatchpointResource::OwnersContains(const Watchpoint *wp) {
   std::lock_guard<std::recursive_mutex> guard(m_owners_mutex);
-  for (WatchpointCollection::const_iterator it = m_owners.begin();
-       it != m_owners.end(); ++it)
-    if ((*it).get() == wp)
-      return true;
-  return false;
+  WatchpointCollection::const_iterator match =
----------------
bulbazord wrote:

My bad... 🤦 

https://github.com/llvm/llvm-project/pull/68845


More information about the lldb-commits mailing list