Skip to content

Commit 51c9f12

Browse files
[mlir] Use StringMap::lookup (NFC)
1 parent 394eeb6 commit 51c9f12

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

mlir/include/mlir/IR/ExtensibleDialect.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -545,10 +545,7 @@ class ExtensibleDialect : public mlir::Dialect {
545545

546546
/// Returns nullptr if the definition was not found.
547547
DynamicTypeDefinition *lookupTypeDefinition(StringRef name) const {
548-
auto it = nameToDynTypes.find(name);
549-
if (it == nameToDynTypes.end())
550-
return nullptr;
551-
return it->second;
548+
return nameToDynTypes.lookup(name);
552549
}
553550

554551
/// Returns nullptr if the definition was not found.
@@ -561,10 +558,7 @@ class ExtensibleDialect : public mlir::Dialect {
561558

562559
/// Returns nullptr if the definition was not found.
563560
DynamicAttrDefinition *lookupAttrDefinition(StringRef name) const {
564-
auto it = nameToDynAttrs.find(name);
565-
if (it == nameToDynAttrs.end())
566-
return nullptr;
567-
return it->second;
561+
return nameToDynAttrs.lookup(name);
568562
}
569563

570564
/// Returns nullptr if the definition was not found.

0 commit comments

Comments
 (0)