diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2022-08-20 15:01:57 +0200 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2022-08-20 15:11:28 +0200 |
commit | 706c8e096978b694fb56dee9e8ed8f55373ad5a0 (patch) | |
tree | 1a49a1c0f46725718523246ad9e7deaef0f39c49 /src/protocol.cpp | |
parent | c73c8d53fe27956faacb3e8ca0e94adf071de6ec (diff) |
refactor: use `strprintf` for creating unknown-service-flag string
No need to use a stringstream here.
Diffstat (limited to 'src/protocol.cpp')
-rw-r--r-- | src/protocol.cpp | 7 |
1 files changed, 1 insertions, 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<std::string> serviceFlagsToStr(uint64_t flags) |