mirror of
https://github.com/hyprwm/hyprutils.git
synced 2025-12-20 08:10:10 +01:00
signal: reserve vector size to avoid reallocations
reserve the vector size to avoid reallocations.
This commit is contained in:
parent
781164dd7c
commit
1fc9436517
1 changed files with 1 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ using namespace Hyprutils::Memory;
|
||||||
|
|
||||||
void Hyprutils::Signal::CSignalBase::emitInternal(void* args) {
|
void Hyprutils::Signal::CSignalBase::emitInternal(void* args) {
|
||||||
std::vector<SP<CSignalListener>> listeners;
|
std::vector<SP<CSignalListener>> listeners;
|
||||||
|
listeners.reserve(m_vListeners.size());
|
||||||
for (auto& l : m_vListeners) {
|
for (auto& l : m_vListeners) {
|
||||||
if (l.expired())
|
if (l.expired())
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue