Add clang-format (#1086)

Co-authored-by: mwilsnd <mwilsnd@gmail.com>
This commit is contained in:
Bart Louwers
2023-05-01 16:57:37 +02:00
committed by GitHub
parent 403a12bd1b
commit 71f6da2722
1018 changed files with 27876 additions and 25862 deletions

View File

@@ -11,11 +11,10 @@ namespace util {
class Timer::Impl : public RunLoop::Impl::Runnable {
public:
Impl() : active(false) {}
Impl()
: active(false) {}
~Impl() {
stop();
}
~Impl() { stop(); }
void start(Duration timeout, Duration repeat_, std::function<void()>&& task_) {
stop();
@@ -23,8 +22,7 @@ public:
repeat = repeat_;
task = std::move(task_);
// Prevent overflows when timeout is set to Duration::max()
due = (timeout == Duration::max()) ? std::chrono::time_point<Clock>::max() : Clock::now() +
timeout;
due = (timeout == Duration::max()) ? std::chrono::time_point<Clock>::max() : Clock::now() + timeout;
loop->addRunnable(this);
active = true;
}
@@ -43,9 +41,7 @@ public:
}
}
TimePoint dueTime() const override {
return due;
}
TimePoint dueTime() const override { return due; }
void runTask() override {
if (active) {
@@ -64,8 +60,8 @@ private:
std::atomic<bool> active;
};
Timer::Timer() : impl(std::make_unique<Impl>()) {
}
Timer::Timer()
: impl(std::make_unique<Impl>()) {}
Timer::~Timer() = default;