Skip to content

Commit e5ef5b9

Browse files
[DebugInfo] Use llvm::erase_value (NFC)
1 parent 8822eaa commit e5ef5b9

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

llvm/lib/DebugInfo/LogicalView/Core/LVScope.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -299,20 +299,12 @@ void LVScope::addMissingElements(LVScope *Reference) {
299299
LVSymbols References;
300300
References.append(ReferenceSymbols->begin(), ReferenceSymbols->end());
301301

302-
auto RemoveSymbol = [&](LVSymbols &Symbols, LVSymbol *Symbol) {
303-
LVSymbols::iterator Iter = std::remove_if(
304-
Symbols.begin(), Symbols.end(),
305-
[Symbol](LVSymbol *Item) -> bool { return Item == Symbol; });
306-
if (Iter != Symbols.end())
307-
Symbols.erase(Iter, Symbols.end());
308-
};
309-
310302
// Erase abstract symbols already in this scope from the collection of
311303
// symbols in the referenced scope.
312304
if (getSymbols())
313305
for (const LVSymbol *Symbol : *getSymbols())
314306
if (Symbol->getHasReferenceAbstract())
315-
RemoveSymbol(References, Symbol->getReference());
307+
llvm::erase_value(References, Symbol->getReference());
316308

317309
// If we have elements left in 'References', those are the elements that
318310
// need to be inserted in the current scope.

0 commit comments

Comments
 (0)