From 706c8e096978b694fb56dee9e8ed8f55373ad5a0 Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Sat, 20 Aug 2022 15:01:57 +0200 Subject: refactor: use `strprintf` for creating unknown-service-flag string No need to use a stringstream here. --- src/protocol.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/protocol.cpp b/src/protocol.cpp index 139405170b..bdd1cc2aff 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -199,12 +199,7 @@ static std::string serviceFlagToStr(size_t bit) // Not using default, so we get warned when a case is missing } - std::ostringstream stream; - stream.imbue(std::locale::classic()); - stream << "UNKNOWN["; - stream << "2^" << bit; - stream << "]"; - return stream.str(); + return strprintf("UNKNOWN[2^%u]", bit); } std::vector serviceFlagsToStr(uint64_t flags) -- cgit v1.2.3