From e63b22a8d75cc6fca86c6c55eb5966e8c79bf5f6 Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Thu, 18 Jul 2024 10:06:29 -0700 Subject: [PATCH] Update dlist.h --- src/util/dlist.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/util/dlist.h b/src/util/dlist.h index 0a5a38b45..52cb25548 100644 --- a/src/util/dlist.h +++ b/src/util/dlist.h @@ -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(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) {