================ @@ -479,25 +479,20 @@ ExplodedGraph::trim(ArrayRef<const NodeTy *> Sinks, // in the trimmed graph, then add the corresponding edges with // `addPredecessor()`, otherwise add them to the worklist. for (const ExplodedNode *Pred : N->Preds) { - auto Iterator = ForwardMap->find(Pred); - if (Iterator != ForwardMap->end()) { - NewN->addPredecessor(const_cast<ExplodedNode *>(Iterator->second), *Trimmed); - } else { + if (const ExplodedNode *Mapped = ForwardMap->lookup(Pred)) + NewN->addPredecessor(const_cast<ExplodedNode *>(Mapped), *Trimmed); ---------------- NagyDonat wrote:
I also had the same idea (`const_cast` is ugly) and I already implemented it before seeing your commit :grin: https://github.com/llvm/llvm-project/pull/139939 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits