Orc fix waitingongraph coalescer remove (#169287)

This commit is contained in:
Lang Hames 2025-11-25 10:46:55 +11:00 committed by GitHub
parent d9cf0db2a2
commit 73de1e26b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -155,22 +155,20 @@ private:
}
template <typename Pred> void remove(Pred &&Remove) {
std::vector<hash_code> HashesToErase;
for (auto &[Hash, SNs] : CanonicalSNs) {
bool Found = false;
for (size_t I = 0; I != SNs.size(); ++I) {
for (size_t I = 0; I != SNs.size();) {
if (Remove(SNs[I])) {
std::swap(SNs[I], SNs.back());
SNs.pop_back();
Found = true;
break;
}
}
if (Found) {
if (SNs.empty())
CanonicalSNs.erase(Hash);
break;
} else
++I;
}
if (SNs.empty())
HashesToErase.push_back(Hash);
}
for (auto Hash : HashesToErase)
CanonicalSNs.erase(Hash);
}
private:
@ -396,9 +394,14 @@ public:
++I;
}
CoalesceToPendingSNs.remove([&](SuperNode *SN) {
for (auto &E : FailedSNs)
if (E.get() == SN)
return true;
return false;
});
for (auto &SN : FailedSNs) {
CoalesceToPendingSNs.remove(
[&](SuperNode *SNC) { return SNC == SN.get(); });
for (auto &[Container, Elems] : SN->Defs) {
assert(ElemToPendingSN.count(Container));
auto &CElems = ElemToPendingSN[Container];