Skip to content

Commit db9e307

Browse files
[mlir] Use a range-based for loop (NFC) (llvm#139756)
WHile I am at it, this patch replaces std::find with llvm::is_contained.
1 parent 298ace7 commit db9e307

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

mlir/lib/Dialect/Tosa/Transforms/TosaProfileCompliance.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,8 @@ LogicalResult TosaProfileCompliance::checkProfileOrExtension(
444444
// Ensure the profile inference match the profile knowledge of the
445445
// specification.
446446
for (const auto &cands : specRequiredModeSet) {
447-
for (size_t i = 0; i < opRequiredMode.size(); i++) {
448-
if (std::find(cands.begin(), cands.end(), opRequiredMode[i]) ==
449-
cands.end()) {
447+
for (const auto &mode : opRequiredMode) {
448+
if (!llvm::is_contained(cands, mode)) {
450449
op->emitOpError() << "illegal: requires ["
451450
<< llvm::join(stringifyProfile<T>(opRequiredMode),
452451
", ")

0 commit comments

Comments
 (0)