[Mlir-commits] [mlir] [mlir] Simplify code with StringMap::operator[] (NFC) (PR #115427)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Nov 7 22:38:21 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir
Author: Kazu Hirata (kazutakahirata)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/115427.diff
1 Files Affected:
- (modified) mlir/lib/IR/MLIRContext.cpp (+1-2)
``````````diff
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(
``````````
</details>
https://github.com/llvm/llvm-project/pull/115427
More information about the Mlir-commits
mailing list