Skip to content

Commit 04c73ad

Browse files
[clang-tools-extra] Use llvm::is_contained (NFC) (#140456)
1 parent e003326 commit 04c73ad

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clang-tools-extra/clang-tidy/bugprone/NarrowingConversionsCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ AST_MATCHER_P(QualType, hasAnyType, std::vector<StringRef>, Names) {
3131
return false;
3232

3333
std::string Name = Node.getLocalUnqualifiedType().getAsString();
34-
return llvm::any_of(Names, [&Name](StringRef Ref) { return Ref == Name; });
34+
return llvm::is_contained(Names, Name);
3535
}
3636

3737
AST_MATCHER(FieldDecl, hasIntBitwidth) {

clang-tools-extra/clangd/CompileCommands.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ void CommandMangler::operator()(tooling::CompileCommand &Command,
315315

316316
// Check whether the flag exists in the command.
317317
auto HasExact = [&](llvm::StringRef Flag) {
318-
return llvm::any_of(Cmd, [&](llvm::StringRef Arg) { return Arg == Flag; });
318+
return llvm::is_contained(Cmd, Flag);
319319
};
320320

321321
// Check whether the flag appears in the command as a prefix.

0 commit comments

Comments
 (0)