[Mlir-commits] [mlir] 0fe37a7 - [mlir] Apply ClangTidy readability finding.

Adrian Kuegel llvmlistbot at llvm.org
Mon Dec 19 00:51:58 PST 2022


Author: Adrian Kuegel
Date: 2022-12-19T09:51:47+01:00
New Revision: 0fe37a75a50bc54d93db299f3126b49b92a8d363

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

LOG: [mlir] Apply ClangTidy readability finding.

Use empty() instead of checking for size 0.

Added: 
    

Modified: 
    mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp b/mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp
index 94b662987dc49..ef44f50adf5e8 100644
--- a/mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp
+++ b/mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp
@@ -385,7 +385,7 @@ void AbstractSparseBackwardDataFlowAnalysis::visitOperation(Operation *op) {
     for (auto [index, block] : llvm::enumerate(op->getSuccessors())) {
       SuccessorOperands successorOperands = branch.getSuccessorOperands(index);
       OperandRange forwarded = successorOperands.getForwardedOperands();
-      if (forwarded.size()) {
+      if (!forwarded.empty()) {
         MutableArrayRef<OpOperand> operands = op->getOpOperands().slice(
             forwarded.getBeginOperandIndex(), forwarded.size());
         for (OpOperand &operand : operands) {


        


More information about the Mlir-commits mailing list