From 69439871e60eeb16993fd6044843d14d2191c9fb Mon Sep 17 00:00:00 2001 From: memchr <118117622+memchr@users.noreply.github.com> Date: Mon, 4 Sep 2023 13:13:39 +0000 Subject: refactor: replace manual iteration of CWindow with existing methods (#3147) --- src/render/decorations/CHyprGroupBarDecoration.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/render') diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp index 89e047ca..70d4ed93 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.cpp +++ b/src/render/decorations/CHyprGroupBarDecoration.cpp @@ -57,15 +57,10 @@ void CHyprGroupBarDecoration::updateWindow(CWindow* pWindow) { } m_dwGroupMembers.clear(); - CWindow* curr = pWindow; - CWindow* head = nullptr; - while (!curr->m_sGroupData.head) { - curr = curr->m_sGroupData.pNextWindow; - } + CWindow* head = pWindow->getGroupHead(); + m_dwGroupMembers.push_back(head); - head = curr; - m_dwGroupMembers.push_back(curr); - curr = curr->m_sGroupData.pNextWindow; + CWindow* curr = head->m_sGroupData.pNextWindow; while (curr != head) { m_dwGroupMembers.push_back(curr); curr = curr->m_sGroupData.pNextWindow; -- cgit v1.2.3