Access map by iterator to silence sanity check. (#18835)

Use iterator to refer to the set.

Co-authored-by: Randy Shuai <rashuai@microsoft.com>
This commit is contained in:
RandySheriffH 2023-12-15 14:57:55 -08:00 committed by GitHub
parent 8f7b89bd5b
commit 2952cf82a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1035,8 +1035,11 @@ class PlannerImpl {
std::function<void(NodeIndex)> dfs = [&](NodeIndex curr) {
if (dependents.find(curr) == dependents.end()) {
dependents.insert(curr);
for (NodeIndex dep : dependence_graph_[curr]) {
dfs(dep);
auto dep_graph_iter = dependence_graph_.find(curr);
if (dep_graph_iter != dependence_graph_.end()) {
for (NodeIndex dep : dep_graph_iter->second) {
dfs(dep);
}
}
}
};