From 717748e8fc6ecd2170aa98ca442727fb1fe32834 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Sun, 1 Dec 2024 12:49:48 +0100 Subject: [PATCH] preserve bin2hex size --- solanaceae/util/utils.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/solanaceae/util/utils.cpp b/solanaceae/util/utils.cpp index 1b387b9..579b0c6 100644 --- a/solanaceae/util/utils.cpp +++ b/solanaceae/util/utils.cpp @@ -46,6 +46,7 @@ std::vector hex2bin(const std::string_view str) { std::string bin2hex(const ByteSpan bin) { std::string str; + str.reserve(bin.size*2); for (size_t i = 0; i < bin.size; i++) { str.push_back(detail::nib_to_hex(bin[i] >> 4)); str.push_back(detail::nib_to_hex(bin[i] & 0x0f));