diff options
author | Vaxry <[email protected]> | 2024-12-16 15:58:19 +0000 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-12-16 15:58:19 +0000 |
commit | a5234f26e4b7146ae7c2df25950f0177534cd643 (patch) | |
tree | be319115cca2eb369791fad1822bdda0e0f358e9 /src/layout | |
parent | de3ad245dcbcd42c88e9afc48264bdb8f2356c15 (diff) | |
download | Hyprland-a5234f26e4b7146ae7c2df25950f0177534cd643.tar.gz Hyprland-a5234f26e4b7146ae7c2df25950f0177534cd643.zip |
core: drop using deques in favor of vectors
No point in most of these.
Diffstat (limited to 'src/layout')
-rw-r--r-- | src/layout/DwindleLayout.cpp | 24 | ||||
-rw-r--r-- | src/layout/DwindleLayout.hpp | 4 | ||||
-rw-r--r-- | src/layout/MasterLayout.hpp | 2 |
3 files changed, 14 insertions, 16 deletions
diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index 32df7676..ec874223 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -38,13 +38,12 @@ void SDwindleNodeData::recalcSizePosRecursive(bool force, bool horizontalOverrid } } -void SDwindleNodeData::getAllChildrenRecursive(std::deque<SDwindleNodeData*>* pDeque) { +void SDwindleNodeData::getAllChildrenRecursive(std::vector<SDwindleNodeData*>* pVec) { if (children[0]) { - children[0]->getAllChildrenRecursive(pDeque); - children[1]->getAllChildrenRecursive(pDeque); - } else { - pDeque->push_back(this); - } + children[0]->getAllChildrenRecursive(pVec); + children[1]->getAllChildrenRecursive(pVec); + } else + pVec->push_back(this); } int CHyprDwindleLayout::getNodesOnWorkspace(const WORKSPACEID& id) { @@ -805,14 +804,13 @@ void CHyprDwindleLayout::recalculateWindow(PHLWINDOW pWindow) { PNODE->recalcSizePosRecursive(); } -void addToDequeRecursive(std::deque<SDwindleNodeData*>* pDeque, std::deque<SDwindleNodeData*>* pParents, SDwindleNodeData* node) { +static void addToVectorRecursive(std::vector<SDwindleNodeData*>* pVec, std::vector<SDwindleNodeData*>* pParents, SDwindleNodeData* node) { if (node->isNode) { - pParents->push_back(node); - addToDequeRecursive(pDeque, pParents, node->children[0]); - addToDequeRecursive(pDeque, pParents, node->children[1]); - } else { - pDeque->emplace_back(node); - } + pParents->emplace_back(node); + addToVectorRecursive(pVec, pParents, node->children[0]); + addToVectorRecursive(pVec, pParents, node->children[1]); + } else + pVec->emplace_back(node); } SWindowRenderLayoutHints CHyprDwindleLayout::requestRenderHints(PHLWINDOW pWindow) { diff --git a/src/layout/DwindleLayout.hpp b/src/layout/DwindleLayout.hpp index 953ba3a2..dffc34f7 100644 --- a/src/layout/DwindleLayout.hpp +++ b/src/layout/DwindleLayout.hpp @@ -4,7 +4,7 @@ #include "../desktop/DesktopTypes.hpp" #include <list> -#include <deque> +#include <vector> #include <array> #include <optional> #include <format> @@ -39,7 +39,7 @@ struct SDwindleNodeData { } void recalcSizePosRecursive(bool force = false, bool horizontalOverride = false, bool verticalOverride = false); - void getAllChildrenRecursive(std::deque<SDwindleNodeData*>*); + void getAllChildrenRecursive(std::vector<SDwindleNodeData*>*); CHyprDwindleLayout* layout = nullptr; }; diff --git a/src/layout/MasterLayout.hpp b/src/layout/MasterLayout.hpp index b72be74f..4841ef08 100644 --- a/src/layout/MasterLayout.hpp +++ b/src/layout/MasterLayout.hpp @@ -5,7 +5,7 @@ #include "../config/ConfigManager.hpp" #include <vector> #include <list> -#include <deque> +#include <vector> #include <any> enum eFullscreenMode : int8_t; |