[Mlir-commits] [mlir] [mlir] Simplify code with StringMap::operator[] (NFC) (PR #115427)
Kazu Hirata
llvmlistbot at llvm.org
Thu Nov 7 22:37:48 PST 2024
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/115427
None
>From 95edc749e9f7b9e293b9a984920b05d0b6ea0250 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Thu, 7 Nov 2024 21:19:10 -0800
Subject: [PATCH] [mlir] Simplify code with StringMap::operator[] (NFC)
---
mlir/lib/IR/MLIRContext.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/mlir/lib/IR/MLIRContext.cpp b/mlir/lib/IR/MLIRContext.cpp
index d33340f4aefc85..b9e745fdf4a13e 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(
More information about the Mlir-commits
mailing list