summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-04-07 18:45:24 +0200
committerlouiz’ <louiz@louiz.org>2017-04-07 18:45:24 +0200
commit5402a256d1f0ebbeafa32d250d000cf38fe748fb (patch)
tree7132c08b9465823c0fd5066eca1fac61ffa7185c /src/utils
parentdd4c54c6cde55c034d756fb736259ce51e0120dc (diff)
downloadbiboumi-5402a256d1f0ebbeafa32d250d000cf38fe748fb.tar.gz
biboumi-5402a256d1f0ebbeafa32d250d000cf38fe748fb.tar.bz2
biboumi-5402a256d1f0ebbeafa32d250d000cf38fe748fb.tar.xz
biboumi-5402a256d1f0ebbeafa32d250d000cf38fe748fb.zip
Apply all the clang-tidy modernize-* fixes
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/encoding.cpp2
-rw-r--r--src/utils/timed_events.cpp13
-rw-r--r--src/utils/timed_events.hpp4
3 files changed, 10 insertions, 9 deletions
diff --git a/src/utils/encoding.cpp b/src/utils/encoding.cpp
index aa91dac..cff0039 100644
--- a/src/utils/encoding.cpp
+++ b/src/utils/encoding.cpp
@@ -4,7 +4,7 @@
#include <stdexcept>
-#include <assert.h>
+#include <cassert>
#include <string.h>
#include <iconv.h>
#include <cerrno>
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))
{
}
diff --git a/src/utils/timed_events.hpp b/src/utils/timed_events.hpp
index 6e28206..393b38d 100644
--- a/src/utils/timed_events.hpp
+++ b/src/utils/timed_events.hpp
@@ -25,9 +25,9 @@ public:
* An event the occurs only once, at the given time_point
*/
explicit TimedEvent(std::chrono::steady_clock::time_point&& time_point,
- std::function<void()> callback, const std::string& name="");
+ std::function<void()> callback, std::string name="");
explicit TimedEvent(std::chrono::milliseconds&& duration,
- std::function<void()> callback, const std::string& name="");
+ std::function<void()> callback, std::string name="");
explicit TimedEvent(TimedEvent&&) = default;
TimedEvent& operator=(TimedEvent&&) = default;