Skip to content

Commit 2fd731f

Browse files
static thread_local string buffer
1 parent 933caf6 commit 2fd731f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/cpp-statsd-client/StatsdClient.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ inline void StatsdClient::send(const std::string& key,
286286
std::stringstream valueStream;
287287
valueStream << std::fixed << std::setprecision(m_gaugePrecision) << value;
288288

289-
std::string buffer;
289+
static thread_local std::string buffer;
290+
buffer.clear();
290291
buffer.reserve(256);
291292

292293
buffer.append(m_prefix);

0 commit comments

Comments
 (0)