mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-05 14:42:01 -07:00
core: reserve vector sizes as much as we can (#9118)
avoid reallocations as much as possible with a few edge cases where the reservation overshoots a tiny bit. but a few bytes of memory short term is better used then the overhead of potential reallocation.
This commit is contained in:
@@ -2785,11 +2785,9 @@ PHLWINDOW CCompositor::getForceFocus() {
|
||||
void CCompositor::arrangeMonitors() {
|
||||
static auto* const PXWLFORCESCALEZERO = (Hyprlang::INT* const*)g_pConfigManager->getConfigValuePtr("xwayland:force_zero_scaling");
|
||||
|
||||
std::vector<PHLMONITOR> toArrange;
|
||||
std::vector<PHLMONITOR> toArrange(m_vMonitors.begin(), m_vMonitors.end());
|
||||
std::vector<PHLMONITOR> arranged;
|
||||
|
||||
for (auto const& m : m_vMonitors)
|
||||
toArrange.push_back(m);
|
||||
arranged.reserve(toArrange.size());
|
||||
|
||||
Debug::log(LOG, "arrangeMonitors: {} to arrange", toArrange.size());
|
||||
|
||||
|
Reference in New Issue
Block a user