Skip to content

Commit 75e0865

Browse files
[clang-tools-extra] Use llvm::unique (NFC) (llvm#139663)
1 parent c95745f commit 75e0865

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

clang-tools-extra/clangd/Hover.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,9 +1270,8 @@ void maybeAddUsedSymbols(ParsedAST &AST, HoverInfo &HI, const Inclusion &Inc) {
12701270
for (const auto &UsedSymbolDecl : UsedSymbols)
12711271
HI.UsedSymbolNames.push_back(getSymbolName(UsedSymbolDecl));
12721272
llvm::sort(HI.UsedSymbolNames);
1273-
HI.UsedSymbolNames.erase(
1274-
std::unique(HI.UsedSymbolNames.begin(), HI.UsedSymbolNames.end()),
1275-
HI.UsedSymbolNames.end());
1273+
HI.UsedSymbolNames.erase(llvm::unique(HI.UsedSymbolNames),
1274+
HI.UsedSymbolNames.end());
12761275
}
12771276

12781277
} // namespace

clang-tools-extra/include-cleaner/lib/HTMLReport.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,7 @@ class Reporter {
186186
R.Satisfied = true;
187187
// Include pointers are meaningfully ordered as they are backed by a vector.
188188
llvm::sort(R.Includes);
189-
R.Includes.erase(std::unique(R.Includes.begin(), R.Includes.end()),
190-
R.Includes.end());
189+
R.Includes.erase(llvm::unique(R.Includes), R.Includes.end());
191190

192191
if (!R.Headers.empty())
193192
R.Insert =

clang-tools-extra/include-cleaner/lib/Record.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,7 @@ class PragmaIncludes::RecordPragma : public PPCallbacks, public CommentHandler {
205205
void EndOfMainFile() override {
206206
for (auto &It : Out->IWYUExportBy) {
207207
llvm::sort(It.getSecond());
208-
It.getSecond().erase(
209-
std::unique(It.getSecond().begin(), It.getSecond().end()),
210-
It.getSecond().end());
208+
It.getSecond().erase(llvm::unique(It.getSecond()), It.getSecond().end());
211209
}
212210
Out->Arena.emplace_back(std::move(Arena));
213211
}

0 commit comments

Comments
 (0)