diff --git a/mlir/lib/IR/MLIRContext.cpp b/mlir/lib/IR/MLIRContext.cpp index d33340f4aefc8..b9e745fdf4a13 100644 --- a/mlir/lib/IR/MLIRContext.cpp +++ b/mlir/lib/IR/MLIRContext.cpp @@ -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(