mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:28:12 +00:00

The TreeMapNode and TreeMap structs inside TreeMapWidget.h both had single implementers, TreeNode and Tree inside main.cpp. The indirection was removed and the new structures were moved to their own file
16 lines
395 B
C++
16 lines
395 B
C++
/*
|
|
* Copyright (c) 2022, the SerenityOS developers.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include "Tree.h"
|
|
#include <AK/QuickSort.h>
|
|
|
|
void TreeNode::sort_children_by_area() const
|
|
{
|
|
if (m_children) {
|
|
Vector<TreeNode>* children = const_cast<Vector<TreeNode>*>(m_children.ptr());
|
|
quick_sort(*children, [](auto& a, auto& b) { return b.m_area < a.m_area; });
|
|
}
|
|
}
|