0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-08 10:31:50 -05:00

Reserve memory for ToLower/ToUpper conversions

This commit is contained in:
Lőrinc 2024-03-08 23:06:22 +01:00
parent 54172c688c
commit 6f2f4a4d09

View file

@ -444,6 +444,7 @@ bool ParseFixedPoint(std::string_view val, int decimals, int64_t *amount_out)
std::string ToLower(std::string_view str)
{
std::string r;
r.reserve(str.size());
for (auto ch : str) r += ToLower(ch);
return r;
}
@ -451,6 +452,7 @@ std::string ToLower(std::string_view str)
std::string ToUpper(std::string_view str)
{
std::string r;
r.reserve(str.size());
for (auto ch : str) r += ToUpper(ch);
return r;
}