diff --git a/src/base/bittorrent/speedmonitor.h b/src/base/bittorrent/speedmonitor.h index 86ececd0b..6bb7c97c9 100644 --- a/src/base/bittorrent/speedmonitor.h +++ b/src/base/bittorrent/speedmonitor.h @@ -38,34 +38,30 @@ template struct Sample { - Sample() - : download() - , upload() - { - } + constexpr Sample() = default; - Sample(T dl, T ul) - : download(dl) - , upload(ul) + constexpr Sample(const T dl, const T ul) + : download {dl} + , upload {ul} { } - Sample &operator+=(const Sample &other) + constexpr Sample &operator+=(const Sample &other) { download += other.download; - upload += other.upload; + upload += other.upload; return *this; } - Sample &operator-=(const Sample &other) + constexpr Sample &operator-=(const Sample &other) { download -= other.download; - upload -= other.upload; + upload -= other.upload; return *this; } - T download; - T upload; + T download {}; + T upload {}; }; typedef Sample SpeedSample;