Skip to content

Commit 668677e

Browse files
committed
lint
1 parent 0906fc0 commit 668677e

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

include/cpp-statsd-client/StatsdClient.hpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ constexpr char METRIC_TYPE_SET[] = "s";
8181
*/
8282
class StatsdClient {
8383
public:
84-
8584
//! A functor that returns a value between 0 and 1 used
8685
//! to determine whether a given message is sampled.
8786
using FrequencyFunc = std::function<float()>;
@@ -96,8 +95,7 @@ class StatsdClient {
9695
const uint64_t batchsize = 0,
9796
const uint64_t sendInterval = 1000,
9897
const int gaugePrecision = 4,
99-
FrequencyFunc frequencyFunc =
100-
std::bind(detail::rand, std::random_device()())) noexcept;
98+
FrequencyFunc frequencyFunc = std::bind(detail::rand, std::random_device()())) noexcept;
10199

102100
StatsdClient(const StatsdClient&) = delete;
103101
StatsdClient& operator=(const StatsdClient&) = delete;
@@ -191,11 +189,11 @@ inline StatsdClient::StatsdClient(const std::string& host,
191189
const uint64_t batchsize,
192190
const uint64_t sendInterval,
193191
const int gaugePrecision,
194-
FrequencyFunc frequencyFunc) noexcept
192+
FrequencyFunc frequencyFunc) noexcept
195193
: m_prefix(detail::sanitizePrefix(prefix)),
196194
m_sender(new UDPSender{host, port, batchsize, sendInterval}),
197-
m_gaugePrecision(gaugePrecision), m_frequencyFunc(std::move(frequencyFunc)) {
198-
}
195+
m_gaugePrecision(gaugePrecision),
196+
m_frequencyFunc(std::move(frequencyFunc)) {}
199197

200198
inline const std::string& StatsdClient::errorMessage() const noexcept {
201199
return m_sender->errorMessage();
@@ -268,8 +266,7 @@ inline void StatsdClient::send(const std::string& key,
268266
constexpr float epsilon{0.0001f};
269267
const bool isFrequencyOne = std::fabs(frequency - 1.0f) < epsilon;
270268
const bool isFrequencyZero = std::fabs(frequency) < epsilon;
271-
if (isFrequencyZero ||
272-
(!isFrequencyOne && (frequency < m_frequencyFunc()))) {
269+
if (isFrequencyZero || (!isFrequencyOne && (frequency < m_frequencyFunc()))) {
273270
return;
274271
}
275272

0 commit comments

Comments
 (0)