[Lldb-commits] [PATCH] D150219: [lldb][NFCI] Remove n^2 loops and simplify iterator usage

Felipe de Azevedo Piovezan via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue May 9 12:19:51 PDT 2023


fdeazeve added inline comments.


================
Comment at: lldb/source/Utility/Broadcaster.cpp:430
 
-  while (true) {
-    auto events_predicate =
-        [&listener](const event_listener_key &input) -> bool {
-      return input.second.get() == listener;
-    };
-    collection::iterator iter, end_iter = m_event_map.end();
-    iter = find_if(m_event_map.begin(), end_iter, events_predicate);
-    if (iter == end_iter)
+  auto events_predicate = [listener](const event_listener_key &input) -> bool {
+    return input.second.get() == listener;
----------------
mib wrote:
> 
`listener` is a raw pointer, we shouldn't capture those by reference


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150219/new/

https://reviews.llvm.org/D150219



More information about the lldb-commits mailing list