aboutsummaryrefslogtreecommitdiff
path: root/src/util/system.cpp
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2019-08-13 12:07:18 +0800
committerfanquake <fanquake@gmail.com>2019-08-13 12:28:22 +0800
commitb799ebcc17ea914b6e50f97f008f498ca31e0f36 (patch)
treeb9b4fa07e116b024c2405de47bcd4354fe37c92c /src/util/system.cpp
parentb499d8576f30d13dfe9000852afe47ee1c28cfbe (diff)
parent0481fa25844dc6ec9f6c3fac8428d874d34b0ad0 (diff)
downloadbitcoin-b799ebcc17ea914b6e50f97f008f498ca31e0f36.tar.xz
Merge #16566: util: refactor upper/lowercase functions
0481fa25844dc6ec9f6c3fac8428d874d34b0ad0 util: refactor upper/lowercase functions (Karl-Johan Alm) Pull request description: This includes renaming Downcase() to ToLower() and make it return a string rather than modify referenced arg. Also adds ToUpper() string version. Additionally, it clarifies that the locale independency of the case functions is a *feature* and not a limitation. I interpreted it as the latter and rewrote code to be locale-aware before realizing this. This is done in preparation for #11413 and as a general refactor. I don't think the optimization that the pre-refactor state gave warrants the unwieldy usage. ACKs for top commit: laanwj: ACK 0481fa25844dc6ec9f6c3fac8428d874d34b0ad0 from me practicalswift: ACK 0481fa25844dc6ec9f6c3fac8428d874d34b0ad0 -- diff looks correct l2a5b1: ACK 0481fa2 - Although, I think @luke-jr's [feedback](https://github.com/bitcoin/bitcoin/pull/16566#issuecomment-519580760) is spot on; `Downcase` is just an artifact of `ParseNetwork`, which has been happily downcasing `net` via a string argument for over 7 years; and I do recommend to add `ToLower` *when* somebody actually needs it in new work, there is no point in keeping a trivial utility function if it is not appreciated. promag: ACK 0481fa25844dc6ec9f6c3fac8428d874d34b0ad0. Tree-SHA512: 9b834ecc1b97db043e261bcbc59e42372e11e2fb9a6943688f18a835bf5c9205f68e4614f58e90ba260d1b8f0e060c6f67b390b62436c21b56891db23bc41628
Diffstat (limited to 'src/util/system.cpp')
-rw-r--r--src/util/system.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/system.cpp b/src/util/system.cpp
index f8fcbc1206..f8bcc45a6a 100644
--- a/src/util/system.cpp
+++ b/src/util/system.cpp
@@ -388,7 +388,7 @@ bool ArgsManager::ParseParameters(int argc, const char* const argv[], std::strin
key.erase(is_index);
}
#ifdef WIN32
- std::transform(key.begin(), key.end(), key.begin(), ToLower);
+ key = ToLower(key);
if (key[0] == '/')
key[0] = '-';
#endif