Skip to content

Conversation

@da-viper
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Nov 16, 2025

@llvm/pr-subscribers-lldb

Author: Ebuka Ezike (da-viper)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/168279.diff

1 Files Affected:

  • (modified) lldb/source/Symbol/Symtab.cpp (+8-16)
diff --git a/lldb/source/Symbol/Symtab.cpp b/lldb/source/Symbol/Symtab.cpp
index 6080703998ff2..f13257147d190 100644
--- a/lldb/source/Symbol/Symtab.cpp
+++ b/lldb/source/Symbol/Symtab.cpp
@@ -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 &&
+             m_symbols[index].GetType() != symbol_type;
+    });
   }
   return indexes.size();
 }
@@ -743,14 +739,10 @@ uint32_t Symtab::AppendSymbolIndexesWithNameAndType(
 
   if (AppendSymbolIndexesWithName(symbol_name, symbol_debug_type,
                                   symbol_visibility, 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 &&
+             m_symbols[index].GetType() != symbol_type;
+    });
   }
   return indexes.size();
 }

@github-actions
Copy link

🐧 Linux x64 Test Results

  • 33123 tests passed
  • 494 tests skipped

@da-viper da-viper merged commit 557a6b8 into llvm:main Nov 17, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants