Skip to content

Commit 2f52bbe

Browse files
[mlir] Use operator==(StringRef, StringRef) (NFC) (llvm#92706)
1 parent 2d5e488 commit 2f52bbe

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

mlir/lib/Dialect/SparseTensor/IR/Detail/LvlTypeParser.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ FailureOr<uint64_t> LvlTypeParser::parseLvlType(AsmParser &parser) const {
3737
uint64_t properties = 0;
3838
SmallVector<unsigned> structured;
3939

40-
if (base.compare("structured") == 0) {
40+
if (base == "structured") {
4141
ParseResult res = parser.parseCommaSeparatedList(
4242
mlir::OpAsmParser::Delimiter::OptionalSquare,
4343
[&]() -> ParseResult { return parseStructured(parser, &structured); },
@@ -60,18 +60,18 @@ FailureOr<uint64_t> LvlTypeParser::parseLvlType(AsmParser &parser) const {
6060
FAILURE_IF_FAILED(res)
6161

6262
// Set the base bit for properties.
63-
if (base.compare("dense") == 0) {
63+
if (base == "dense") {
6464
properties |= static_cast<uint64_t>(LevelFormat::Dense);
65-
} else if (base.compare("batch") == 0) {
65+
} else if (base == "batch") {
6666
properties |= static_cast<uint64_t>(LevelFormat::Batch);
67-
} else if (base.compare("compressed") == 0) {
67+
} else if (base == "compressed") {
6868
properties |= static_cast<uint64_t>(LevelFormat::Compressed);
69-
} else if (base.compare("structured") == 0) {
69+
} else if (base == "structured") {
7070
properties |= static_cast<uint64_t>(LevelFormat::NOutOfM);
7171
properties |= nToBits(structured[0]) | mToBits(structured[1]);
72-
} else if (base.compare("loose_compressed") == 0) {
72+
} else if (base == "loose_compressed") {
7373
properties |= static_cast<uint64_t>(LevelFormat::LooseCompressed);
74-
} else if (base.compare("singleton") == 0) {
74+
} else if (base == "singleton") {
7575
properties |= static_cast<uint64_t>(LevelFormat::Singleton);
7676
} else {
7777
parser.emitError(loc, "unknown level format: ") << base;

0 commit comments

Comments
 (0)