Skip to content

Commit 2ba20c5

Browse files
[lldb] Use llvm::unique (NFC) (#136527)
1 parent 6274442 commit 2ba20c5

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

lldb/source/Symbol/Symtab.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ void Symtab::SortSymbolIndexesByValue(std::vector<uint32_t> &indexes,
642642

643643
// Remove any duplicates if requested
644644
if (remove_duplicates) {
645-
auto last = std::unique(indexes.begin(), indexes.end());
645+
auto last = llvm::unique(indexes);
646646
indexes.erase(last, indexes.end());
647647
}
648648
}
@@ -1151,9 +1151,7 @@ void Symtab::FindFunctionSymbols(ConstString name, uint32_t name_type_mask,
11511151

11521152
if (!symbol_indexes.empty()) {
11531153
llvm::sort(symbol_indexes);
1154-
symbol_indexes.erase(
1155-
std::unique(symbol_indexes.begin(), symbol_indexes.end()),
1156-
symbol_indexes.end());
1154+
symbol_indexes.erase(llvm::unique(symbol_indexes), symbol_indexes.end());
11571155
SymbolIndicesToSymbolContextList(symbol_indexes, sc_list);
11581156
}
11591157
}

lldb/source/Target/Target.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2641,9 +2641,8 @@ Target::GetScratchTypeSystems(bool create_on_demand) {
26412641
}
26422642

26432643
std::sort(scratch_type_systems.begin(), scratch_type_systems.end());
2644-
scratch_type_systems.erase(
2645-
std::unique(scratch_type_systems.begin(), scratch_type_systems.end()),
2646-
scratch_type_systems.end());
2644+
scratch_type_systems.erase(llvm::unique(scratch_type_systems),
2645+
scratch_type_systems.end());
26472646
return scratch_type_systems;
26482647
}
26492648

lldb/tools/lldb-dap/Handler/BreakpointLocationsHandler.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,7 @@ void BreakpointLocationsRequestHandler::operator()(
189189
// The line entries are sorted by addresses, but we must return the list
190190
// ordered by line / column position.
191191
std::sort(locations.begin(), locations.end());
192-
locations.erase(std::unique(locations.begin(), locations.end()),
193-
locations.end());
192+
locations.erase(llvm::unique(locations), locations.end());
194193

195194
llvm::json::Array locations_json;
196195
for (auto &l : locations) {

0 commit comments

Comments
 (0)