mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-10-05 17:46:28 +00: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:
@@ -34,6 +34,9 @@ CDRMLeaseResource::CDRMLeaseResource(SP<CWpDrmLeaseV1> resource_, SP<CDRMLeaseRe
|
||||
}());
|
||||
|
||||
std::vector<SP<Aquamarine::IOutput>> outputs;
|
||||
// reserve to avoid reallocations
|
||||
outputs.reserve(requested.size());
|
||||
|
||||
for (auto const& m : requested) {
|
||||
outputs.emplace_back(m->monitor->output);
|
||||
}
|
||||
|
Reference in New Issue
Block a user