[lldb] Use llvm::unique (NFC) (#136527)

This commit is contained in:
Kazu Hirata
2025-04-20 19:59:37 -07:00
committed by GitHub
parent 6274442f8c
commit 2ba20c52e4
3 changed files with 5 additions and 9 deletions

View File

@@ -642,7 +642,7 @@ void Symtab::SortSymbolIndexesByValue(std::vector<uint32_t> &indexes,
// Remove any duplicates if requested
if (remove_duplicates) {
auto last = std::unique(indexes.begin(), indexes.end());
auto last = llvm::unique(indexes);
indexes.erase(last, indexes.end());
}
}
@@ -1151,9 +1151,7 @@ void Symtab::FindFunctionSymbols(ConstString name, uint32_t name_type_mask,
if (!symbol_indexes.empty()) {
llvm::sort(symbol_indexes);
symbol_indexes.erase(
std::unique(symbol_indexes.begin(), symbol_indexes.end()),
symbol_indexes.end());
symbol_indexes.erase(llvm::unique(symbol_indexes), symbol_indexes.end());
SymbolIndicesToSymbolContextList(symbol_indexes, sc_list);
}
}

View File

@@ -2641,9 +2641,8 @@ Target::GetScratchTypeSystems(bool create_on_demand) {
}
std::sort(scratch_type_systems.begin(), scratch_type_systems.end());
scratch_type_systems.erase(
std::unique(scratch_type_systems.begin(), scratch_type_systems.end()),
scratch_type_systems.end());
scratch_type_systems.erase(llvm::unique(scratch_type_systems),
scratch_type_systems.end());
return scratch_type_systems;
}

View File

@@ -189,8 +189,7 @@ void BreakpointLocationsRequestHandler::operator()(
// The line entries are sorted by addresses, but we must return the list
// ordered by line / column position.
std::sort(locations.begin(), locations.end());
locations.erase(std::unique(locations.begin(), locations.end()),
locations.end());
locations.erase(llvm::unique(locations), locations.end());
llvm::json::Array locations_json;
for (auto &l : locations) {