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:
parent
54172c688c
commit
6f2f4a4d09
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue