[llvm] ef1cf34 - [Support] Use is_contained (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 10 20:40:57 PST 2020


Author: Kazu Hirata
Date: 2020-12-10T20:40:37-08:00
New Revision: ef1cf345bbc56501f775330ec4a010d22443f6b7

URL: https://github.com/llvm/llvm-project/commit/ef1cf345bbc56501f775330ec4a010d22443f6b7
DIFF: https://github.com/llvm/llvm-project/commit/ef1cf345bbc56501f775330ec4a010d22443f6b7.diff

LOG: [Support] Use is_contained (NFC)

Added: 
    

Modified: 
    llvm/lib/Support/CommandLine.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp
index a185863fddb9..1b9436d56fdb 100644
--- a/llvm/lib/Support/CommandLine.cpp
+++ b/llvm/lib/Support/CommandLine.cpp
@@ -464,7 +464,7 @@ void Option::addCategory(OptionCategory &C) {
   // must be explicitly added if you want multiple categories that include it.
   if (&C != &GeneralCategory && Categories[0] == &GeneralCategory)
     Categories[0] = &C;
-  else if (find(Categories, &C) == Categories.end())
+  else if (!is_contained(Categories, &C))
     Categories.push_back(&C);
 }
 
@@ -2590,7 +2590,7 @@ void cl::HideUnrelatedOptions(ArrayRef<const cl::OptionCategory *> Categories,
                               SubCommand &Sub) {
   for (auto &I : Sub.OptionsMap) {
     for (auto &Cat : I.second->Categories) {
-      if (find(Categories, Cat) == Categories.end() && Cat != &GenericCategory)
+      if (!is_contained(Categories, Cat) && Cat != &GenericCategory)
         I.second->setHiddenFlag(cl::ReallyHidden);
     }
   }


        


More information about the llvm-commits mailing list