Skip to content

Commit

Permalink
[mlir] Simplify code with StringMap::operator[] (NFC) (llvm#115427)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata authored Nov 8, 2024
1 parent 6ce4426 commit a4819d6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mlir/lib/IR/MLIRContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -986,8 +986,7 @@ void RegisteredOperationName::insert(
}
StringRef name = impl->getName().strref();
// Insert the operation info if it doesn't exist yet.
auto it = ctxImpl.operations.insert({name, nullptr});
it.first->second = std::move(ownedImpl);
ctxImpl.operations[name] = std::move(ownedImpl);

// Update the registered info for this operation.
auto emplaced = ctxImpl.registeredOperations.try_emplace(
Expand Down

0 comments on commit a4819d6

Please sign in to comment.