diff options
author | MarcoFalke <falke.marco@gmail.com> | 2019-01-10 12:09:20 -0500 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2019-01-10 12:09:25 -0500 |
commit | 68dddccdaa6f55210a8798c8ccbc942ecec55429 (patch) | |
tree | e324c8eddf8bb8007ed1c3a9dc7e9f654d3d7cf1 /src/util/strencodings.cpp | |
parent | cebe910718ae4f099f292736192a4e725ad02b94 (diff) | |
parent | 332b3dd7c156daa08df347dc3359f0ee99ce4baa (diff) |
Merge #15139: util: Remove [U](BEGIN|END) macros
332b3dd7c1 util: Make ToLower and ToUpper take a char (Wladimir J. van der Laan)
edb5bb3500 util: remove unused [U](BEGIN|END) macros (Wladimir J. van der Laan)
7fa238c701 Replace use of BEGIN and END macros on uint256 (Wladimir J. van der Laan)
Pull request description:
Two cleanups in `util/strencodings.h`:
- Remove `[U](BEGIN|END)` macros — The only use of these was in the Merkle tree code with `uint256` which has its own `begin` and `end` methods which are better.
- Make ToLower and ToUpper take a char — Unfortunately, `std::string` elements are (bare) chars. As these are the most likely type to be passed to these functions, make them use char instead of unsigned char. This avoids some casts.
Tree-SHA512: 96c8292e1b588d3d7fde95c2e98ad4e7eb75e7baab40a8e8e8209d4e8e7a1bd3b6846601d20976be34a9daabefc50cbc23f3b04200af17d0dfc857c4ec42aca7
Diffstat (limited to 'src/util/strencodings.cpp')
-rw-r--r-- | src/util/strencodings.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/strencodings.cpp b/src/util/strencodings.cpp index 46146be66f..fedeeac39b 100644 --- a/src/util/strencodings.cpp +++ b/src/util/strencodings.cpp @@ -589,7 +589,7 @@ bool ParseHDKeypath(const std::string& keypath_str, std::vector<uint32_t>& keypa void Downcase(std::string& str) { - std::transform(str.begin(), str.end(), str.begin(), [](unsigned char c){return ToLower(c);}); + std::transform(str.begin(), str.end(), str.begin(), [](char c){return ToLower(c);}); } std::string Capitalize(std::string str) |