[Mlir-commits] [mlir] [mlir] Simplify code with MapVector::operator[] (NFC) (PR #113407)

Kazu Hirata llvmlistbot at llvm.org
Tue Oct 22 20:02:50 PDT 2024


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/113407

None

>From 98d9588d6327b87e350075001b10b4ad210198ae Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Tue, 22 Oct 2024 08:07:19 -0700
Subject: [PATCH] [mlir] Simplify code with MapVector::operator[] (NFC)

---
 mlir/lib/Conversion/PDLToPDLInterp/PredicateTree.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlir/lib/Conversion/PDLToPDLInterp/PredicateTree.cpp b/mlir/lib/Conversion/PDLToPDLInterp/PredicateTree.cpp
index fe27a22294914e..dab15d23f6e0f5 100644
--- a/mlir/lib/Conversion/PDLToPDLInterp/PredicateTree.cpp
+++ b/mlir/lib/Conversion/PDLToPDLInterp/PredicateTree.cpp
@@ -818,7 +818,7 @@ std::unique_ptr<MatcherNode> &getOrCreateChild(SwitchNode *node,
   auto it = predicate->patternToAnswer.find(pattern);
   assert(it != predicate->patternToAnswer.end() &&
          "expected pattern to exist in predicate");
-  return node->getChildren().insert({it->second, nullptr}).first->second;
+  return node->getChildren()[it->second];
 }
 
 /// Build the matcher CFG by "pushing" patterns through by sorted predicate



More information about the Mlir-commits mailing list