[llvm] [Option] Use llvm::is_contained (NFC) (PR #168295)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 16 15:07:22 PST 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/168295

Identified with llvm-use-ranges.


>From c70f52da3c0f8ec7f3cdebe014119d3f2ba35d1f Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sun, 16 Nov 2025 14:21:13 -0800
Subject: [PATCH] [Option] Use llvm::is_contained (NFC)

Identified with llvm-use-ranges.
---
 llvm/lib/Option/OptTable.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

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