[clang-tools-extra] Use llvm::unique (NFC) (#139663)

This commit is contained in:
Kazu Hirata
2025-05-12 23:24:24 -07:00
committed by GitHub
parent c95745f2db
commit 75e0865837
3 changed files with 4 additions and 8 deletions

View File

@@ -1270,9 +1270,8 @@ void maybeAddUsedSymbols(ParsedAST &AST, HoverInfo &HI, const Inclusion &Inc) {
for (const auto &UsedSymbolDecl : UsedSymbols)
HI.UsedSymbolNames.push_back(getSymbolName(UsedSymbolDecl));
llvm::sort(HI.UsedSymbolNames);
HI.UsedSymbolNames.erase(
std::unique(HI.UsedSymbolNames.begin(), HI.UsedSymbolNames.end()),
HI.UsedSymbolNames.end());
HI.UsedSymbolNames.erase(llvm::unique(HI.UsedSymbolNames),
HI.UsedSymbolNames.end());
}
} // namespace

View File

@@ -186,8 +186,7 @@ class Reporter {
R.Satisfied = true;
// Include pointers are meaningfully ordered as they are backed by a vector.
llvm::sort(R.Includes);
R.Includes.erase(std::unique(R.Includes.begin(), R.Includes.end()),
R.Includes.end());
R.Includes.erase(llvm::unique(R.Includes), R.Includes.end());
if (!R.Headers.empty())
R.Insert =

View File

@@ -205,9 +205,7 @@ public:
void EndOfMainFile() override {
for (auto &It : Out->IWYUExportBy) {
llvm::sort(It.getSecond());
It.getSecond().erase(
std::unique(It.getSecond().begin(), It.getSecond().end()),
It.getSecond().end());
It.getSecond().erase(llvm::unique(It.getSecond()), It.getSecond().end());
}
Out->Arena.emplace_back(std::move(Arena));
}