mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 10:38:42 +01:00
Reserve hrp memory in Decode and LocateErrors
This commit is contained in:
parent
ff7d2054c4
commit
d5ece3c4b5
@ -393,6 +393,7 @@ DecodeResult Decode(const std::string& str, CharLimit limit) {
|
||||
values[i] = rev;
|
||||
}
|
||||
std::string hrp;
|
||||
hrp.reserve(pos);
|
||||
for (size_t i = 0; i < pos; ++i) {
|
||||
hrp += LowerCase(str[i]);
|
||||
}
|
||||
@ -425,6 +426,7 @@ std::pair<std::string, std::vector<int>> LocateErrors(const std::string& str, Ch
|
||||
}
|
||||
|
||||
std::string hrp;
|
||||
hrp.reserve(pos);
|
||||
for (size_t i = 0; i < pos; ++i) {
|
||||
hrp += LowerCase(str[i]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user