[llvm] 498a01d - [Option] Use llvm::is_contained (NFC) (#168295)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 17 07:59:41 PST 2025
Author: Kazu Hirata
Date: 2025-11-17T07:59:37-08:00
New Revision: 498a01db9b1a5424e28665aa0c02eacad5ab027f
URL: https://github.com/llvm/llvm-project/commit/498a01db9b1a5424e28665aa0c02eacad5ab027f
DIFF: https://github.com/llvm/llvm-project/commit/498a01db9b1a5424e28665aa0c02eacad5ab027f.diff
LOG: [Option] Use llvm::is_contained (NFC) (#168295)
Identified with llvm-use-ranges.
Added:
Modified:
llvm/lib/Option/OptTable.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Option/OptTable.cpp b/llvm/lib/Option/OptTable.cpp
index 20398b5f582f4..065036cedc2ae 100644
--- a/llvm/lib/Option/OptTable.cpp
+++ b/llvm/lib/Option/OptTable.cpp
@@ -796,8 +796,7 @@ void OptTable::internalPrintHelp(
unsigned ActiveSubCommandID = ActiveSubCommand - &SubCommands[0];
// Print if the ActiveSubCommandID is registered with the CandidateInfo
// Option.
- return std::find(SubCommandIDs.begin(), SubCommandIDs.end(),
- ActiveSubCommandID) != SubCommandIDs.end();
+ return llvm::is_contained(SubCommandIDs, ActiveSubCommandID);
};
for (unsigned Id = 1, e = getNumOptions() + 1; Id != e; ++Id) {
More information about the llvm-commits
mailing list