mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Reserve memory for ToLower/ToUpper conversions
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user