[flang] Use llvm::is_contained (NFC)
authorKazu Hirata <kazu@google.com>
Mon, 7 Nov 2022 03:58:51 +0000 (19:58 -0800)
committerKazu Hirata <kazu@google.com>
Mon, 7 Nov 2022 03:58:51 +0000 (19:58 -0800)
flang/lib/Semantics/compute-offsets.cpp

index 237b6b6..779afa6 100644 (file)
@@ -174,8 +174,7 @@ void ComputeOffsetsHelper::DoCommonBlock(Symbol &commonBlock) {
       if (const auto *baseBlock{FindCommonBlockContaining(base)}) {
         if (baseBlock == &commonBlock) {
           if (base.offset() != symbol.offset() - dep.offset ||
-              std::find(details.objects().begin(), details.objects().end(),
-                  base) != details.objects().end()) {
+              llvm::is_contained(details.objects(), base)) {
             context_.Say(errorSite,
                 "'%s' is storage associated with '%s' by EQUIVALENCE elsewhere in COMMON block /%s/"_err_en_US,
                 symbol.name(), base.name(), commonBlock.name());