summaryrefslogtreecommitdiff
path: root/src/utils/timed_events.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/timed_events.cpp')
-rw-r--r--src/utils/timed_events.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/utils/timed_events.cpp b/src/utils/timed_events.cpp
index 5077199..e35a659 100644
--- a/src/utils/timed_events.cpp
+++ b/src/utils/timed_events.cpp
@@ -1,22 +1,23 @@
+#include <utility>
#include <utils/timed_events.hpp>
TimedEvent::TimedEvent(std::chrono::steady_clock::time_point&& time_point,
- std::function<void()> callback, const std::string& name):
+ std::function<void()> callback, std::string name):
time_point(std::move(time_point)),
- callback(callback),
+ callback(std::move(callback)),
repeat(false),
repeat_delay(0),
- name(name)
+ name(std::move(name))
{
}
TimedEvent::TimedEvent(std::chrono::milliseconds&& duration,
- std::function<void()> callback, const std::string& name):
+ std::function<void()> callback, std::string name):
time_point(std::chrono::steady_clock::now() + duration),
- callback(callback),
+ callback(std::move(callback)),
repeat(true),
repeat_delay(std::move(duration)),
- name(name)
+ name(std::move(name))
{
}