================
@@ -723,14 +723,10 @@ Symtab::AppendSymbolIndexesWithNameAndType(ConstString 
symbol_name,
   std::lock_guard<std::recursive_mutex> guard(m_mutex);
 
   if (AppendSymbolIndexesWithName(symbol_name, indexes) > 0) {
-    std::vector<uint32_t>::iterator pos = indexes.begin();
-    while (pos != indexes.end()) {
-      if (symbol_type == eSymbolTypeAny ||
-          m_symbols[*pos].GetType() == symbol_type)
-        ++pos;
-      else
-        pos = indexes.erase(pos);
-    }
+    llvm::erase_if(indexes, [this, symbol_type](uint32_t index) {
+      return symbol_type != eSymbolTypeAny &&
----------------
JDevlieghere wrote:

Since `symbol_type` is constant, if `symbol_type == eSymbolTypeAny`, can't we 
just skip the whole loop/erase_if? 

https://github.com/llvm/llvm-project/pull/168279
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to