summaryrefslogtreecommitdiff
path: root/src/lib/event_history.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-12-31 22:33:31 +0100
committerCarl Hetherington <cth@carlh.net>2025-12-31 22:33:31 +0100
commitf51e9c758a39932625a52ebecc9e3c6f8b807cfd (patch)
treec9daf47c90b621965779da9114b85bdba19e7624 /src/lib/event_history.cc
parent0caf7b043dc9654918458b168a115b39f623267c (diff)
White space: event_history.{cc,h}
Diffstat (limited to 'src/lib/event_history.cc')
-rw-r--r--src/lib/event_history.cc22
1 files changed, 11 insertions, 11 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();
}
}