[mlir][OpenMP] Apply ClangTidy readability finding.
authorAdrian Kuegel <akuegel@google.com>
Wed, 31 Aug 2022 08:38:19 +0000 (10:38 +0200)
committerAdrian Kuegel <akuegel@google.com>
Wed, 31 Aug 2022 08:38:19 +0000 (10:38 +0200)
Use .empty() check instead of size() check.

mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp

index b4e05c5..46f1ed3 100644 (file)
@@ -707,7 +707,7 @@ LogicalResult TaskLoopOp::verify() {
           verifyReductionVarList(*this, in_reductions(), in_reduction_vars())))
     return failure();
 
-  if (reduction_vars().size() > 0 && nogroup())
+  if (!reduction_vars().empty() && nogroup())
     return emitError("if a reduction clause is present on the taskloop "
                      "directive, the nogroup clause must not be specified");
   for (auto var : reduction_vars()) {