[Support] Use is_contained (NFC)

This commit is contained in:
Kazu Hirata 2020-12-10 20:40:37 -08:00
parent bc633fe46b
commit ef1cf345bb
1 changed files with 2 additions and 2 deletions

View File

@ -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);
}
}