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

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Nov 4 09:40:25 PST 2024


Author: Kazu Hirata
Date: 2024-11-04T09:40:21-08:00
New Revision: 5d6cb6f78ac93aedcf96e3a3bca61401a2177f31

URL: https://github.com/llvm/llvm-project/commit/5d6cb6f78ac93aedcf96e3a3bca61401a2177f31
DIFF: https://github.com/llvm/llvm-project/commit/5d6cb6f78ac93aedcf96e3a3bca61401a2177f31.diff

LOG: [mlir] Simplify code with MapVector::operator[] (NFC) (#113407)

Added: 
    

Modified: 
    mlir/lib/Conversion/PDLToPDLInterp/PredicateTree.cpp

Removed: 
    


################################################################################
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