diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-12-31 22:33:31 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-12-31 22:33:31 +0100 |
| commit | f51e9c758a39932625a52ebecc9e3c6f8b807cfd (patch) | |
| tree | c9daf47c90b621965779da9114b85bdba19e7624 /src/lib | |
| parent | 0caf7b043dc9654918458b168a115b39f623267c (diff) | |
White space: event_history.{cc,h}
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/event_history.cc | 22 | ||||
| -rw-r--r-- | src/lib/event_history.h | 8 |
2 files changed, 15 insertions, 15 deletions
diff --git a/src/lib/event_history.cc b/src/lib/event_history.cc index fca88aaf1..f68a6c9b9 100644 --- a/src/lib/event_history.cc +++ b/src/lib/event_history.cc @@ -27,37 +27,37 @@ using boost::optional; -EventHistory::EventHistory (int size) - : _size (size) +EventHistory::EventHistory(int size) + : _size(size) { } optional<float> -EventHistory::rate () const +EventHistory::rate() const { - boost::mutex::scoped_lock lock (_mutex); + boost::mutex::scoped_lock lock(_mutex); if (int(_history.size()) < _size) { return {}; } struct timeval now; - gettimeofday (&now, 0); + gettimeofday(&now, 0); - return _size / (seconds (now) - seconds (_history.back ())); + return _size / (seconds(now) - seconds(_history.back())); } void -EventHistory::event () +EventHistory::event() { - boost::mutex::scoped_lock lock (_mutex); + boost::mutex::scoped_lock lock(_mutex); struct timeval tv; - gettimeofday (&tv, 0); - _history.push_front (tv); + gettimeofday(&tv, 0); + _history.push_front(tv); if (int(_history.size()) > _size) { - _history.pop_back (); + _history.pop_back(); } } diff --git a/src/lib/event_history.h b/src/lib/event_history.h index a98447f42..63329fa0e 100644 --- a/src/lib/event_history.h +++ b/src/lib/event_history.h @@ -23,18 +23,18 @@ #define DCPOMATIC_EVENT_HISTORY_H -#include <boost/thread/mutex.hpp> #include <boost/optional.hpp> +#include <boost/thread/mutex.hpp> #include <list> class EventHistory { public: - explicit EventHistory (int size); + explicit EventHistory(int size); - boost::optional<float> rate () const; - void event (); + boost::optional<float> rate() const; + void event(); private: /** Mutex for _history */ |
