From 93d3948bfbf1cc5a69a9b13a3890ea209baa4be6 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Tue, 4 Apr 2023 00:14:44 +0200 Subject: [PATCH] Remove unnecessary parents deque from addChildNodesToDequeRecursive --- src/main.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 341d052..d813e39 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -14,12 +14,11 @@ inline std::function originalToggleGroup = nullptr; typedef SDwindleNodeData* (*nodeFromWindowT)(void*, CWindow*); inline nodeFromWindowT g_pNodeFromWindow = nullptr; -void addChildNodesToDequeRecursive(std::deque* pDeque, std::deque* pParents, SDwindleNodeData* node) +void addChildNodesToDequeRecursive(std::deque* pDeque, SDwindleNodeData* node) { if (node->isNode) { - pParents->push_back(node); - addChildNodesToDequeRecursive(pDeque, pParents, node->children[0]); - addChildNodesToDequeRecursive(pDeque, pParents, node->children[1]); + addChildNodesToDequeRecursive(pDeque, node->children[0]); + addChildNodesToDequeRecursive(pDeque, node->children[1]); } else { pDeque->emplace_back(node); @@ -64,10 +63,8 @@ void groupCreate(const SDwindleNodeData* PNODE, CHyprDwindleLayout* layout) originalToggleGroup(""); std::deque newGroupMembers; - std::deque parentNodes; - addChildNodesToDequeRecursive( - &newGroupMembers, &parentNodes, PNODE->pParent->children[0] == PNODE ? PNODE->pParent->children[1] : PNODE->pParent->children[0]); + addChildNodesToDequeRecursive(&newGroupMembers, PNODE->pParent->children[0] == PNODE ? PNODE->pParent->children[1] : PNODE->pParent->children[0]); // Make sure one of the child nodes isn't itself a group for (auto& n : newGroupMembers) {