3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-22 00:26:38 +00:00

Update dlist.h

This commit is contained in:
Nikolaj Bjorner 2024-07-18 10:06:29 -07:00 committed by GitHub
parent 8787d0a501
commit e63b22a8d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -163,17 +163,15 @@ public:
// m_next of each node should point back to m_prev of the following node,
// and m_prev of each node should point forward to m_next of the preceding node.
while (slow != fast) {
if (fast->m_prev->m_next != fast || fast->m_next->m_prev != fast) {
return false;
}
if (fast->m_prev->m_next != fast || fast->m_next->m_prev != fast)
return false;
fast = fast->m_next;
looped = looped || (fast == static_cast<const T*>(this));
if (!looped && fast == m_next) {
if (!looped && fast == m_next)
// We should be able to traverse back to the starting node.
return false;
}
return false;
}
return true;
return true;
}
static bool contains(T const* list, T const* elem) {