From 0fe37a75a50bc54d93db299f3126b49b92a8d363 Mon Sep 17 00:00:00 2001 From: Adrian Kuegel Date: Mon, 19 Dec 2022 09:50:43 +0100 Subject: [PATCH] [mlir] Apply ClangTidy readability finding. Use empty() instead of checking for size 0. --- mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp b/mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp index 94b6629..ef44f50 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 operands = op->getOpOperands().slice( forwarded.getBeginOperandIndex(), forwarded.size()); for (OpOperand &operand : operands) { -- 2.7.4