CVar: std::move listeners within addListener()

std::function is allowed to heap allocate in order to hold any necessary
captures, so we should be std::move-ing instances here in order to avoid
potentially performing reallocations.
This commit is contained in:
Lioncash 2019-08-24 16:27:26 -04:00
parent d39caf54bb
commit 3dc10e7473
1 changed files with 1 additions and 1 deletions

View File

@ -117,7 +117,7 @@ public:
*/ */
void lock(); void lock();
void addListener(ListenerFunc func) { m_listeners.push_back(func); } void addListener(ListenerFunc func) { m_listeners.push_back(std::move(func)); }
private: private:
void dispatch(); void dispatch();