[mlir] Use StringMap::lookup (NFC)

This commit is contained in:
Kazu Hirata 2023-08-19 00:05:32 -07:00
parent 394eeb6e45
commit 51c9f12a52

View File

@ -545,10 +545,7 @@ public:
/// Returns nullptr if the definition was not found.
DynamicTypeDefinition *lookupTypeDefinition(StringRef name) const {
auto it = nameToDynTypes.find(name);
if (it == nameToDynTypes.end())
return nullptr;
return it->second;
return nameToDynTypes.lookup(name);
}
/// Returns nullptr if the definition was not found.
@ -561,10 +558,7 @@ public:
/// Returns nullptr if the definition was not found.
DynamicAttrDefinition *lookupAttrDefinition(StringRef name) const {
auto it = nameToDynAttrs.find(name);
if (it == nameToDynAttrs.end())
return nullptr;
return it->second;
return nameToDynAttrs.lookup(name);
}
/// Returns nullptr if the definition was not found.