We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f1d0e1 commit 5e1e6a6Copy full SHA for 5e1e6a6
mlir/lib/TableGen/Pattern.cpp
@@ -137,11 +137,10 @@ llvm::StringRef DagNode::getSymbol() const { return node->getNameStr(); }
137
138
Operator &DagNode::getDialectOp(RecordOperatorMap *mapper) const {
139
llvm::Record *opDef = cast<llvm::DefInit>(node->getOperator())->getDef();
140
- auto it = mapper->find(opDef);
141
- if (it != mapper->end())
142
- return *it->second;
143
- return *mapper->try_emplace(opDef, std::make_unique<Operator>(opDef))
144
- .first->second;
+ auto [it, inserted] = mapper->try_emplace(opDef);
+ if (inserted)
+ it->second = std::make_unique<Operator>(opDef);
+ return *it->second;
145
}
146
147
int DagNode::getNumOps() const {
0 commit comments