signal: reserve vector size to avoid reallocations

reserve the vector size to avoid reallocations.
This commit is contained in:
Tom Englund 2025-07-11 15:29:12 +02:00
parent 781164dd7c
commit 1fc9436517

View file

@ -11,6 +11,7 @@ using namespace Hyprutils::Memory;
void Hyprutils::Signal::CSignalBase::emitInternal(void* args) {
std::vector<SP<CSignalListener>> listeners;
listeners.reserve(m_vListeners.size());
for (auto& l : m_vListeners) {
if (l.expired())
continue;