diff options
author | MacroFake <falke.marco@gmail.com> | 2022-05-13 12:32:59 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-05-18 19:15:03 +0200 |
commit | fa9af218780b7960d756db80c57222e5bf2137b1 (patch) | |
tree | d2388623573ec1a756aac320555ffa106d42743e /src/util | |
parent | e016c00e98b8e460c965cab050cb08a4f1a1d6f1 (diff) |
scripted-diff: Use getInt<T> over get_int/get_int64
-BEGIN VERIFY SCRIPT-
sed -i 's|\<get_int64\>|getInt<int64_t>|g' $(git grep -l get_int ':(exclude)src/univalue')
sed -i 's|\<get_int\>|getInt<int>|g' $(git grep -l get_int ':(exclude)src/univalue')
-END VERIFY SCRIPT-
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/settings.h | 2 | ||||
-rw-r--r-- | src/util/system.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/util/settings.h b/src/util/settings.h index ed36349232..261a0a032f 100644 --- a/src/util/settings.h +++ b/src/util/settings.h @@ -20,7 +20,7 @@ namespace util { //! @note UniValue is used here for convenience and because it can be easily //! serialized in a readable format. But any other variant type that can //! be assigned strings, int64_t, and bool values and has get_str(), -//! get_int64(), get_bool(), isNum(), isBool(), isFalse(), isTrue() and +//! getInt<int64_t>(), get_bool(), isNum(), isBool(), isFalse(), isTrue() and //! isNull() methods can be substituted if there's a need to move away //! from UniValue. (An implementation with boost::variant was posted at //! https://github.com/bitcoin/bitcoin/pull/15934/files#r337691812) diff --git a/src/util/system.cpp b/src/util/system.cpp index 44ebf5cb3e..e35db6c2d9 100644 --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -606,7 +606,7 @@ std::string ArgsManager::GetArg(const std::string& strArg, const std::string& st int64_t ArgsManager::GetIntArg(const std::string& strArg, int64_t nDefault) const { const util::SettingsValue value = GetSetting(strArg); - return value.isNull() ? nDefault : value.isFalse() ? 0 : value.isTrue() ? 1 : value.isNum() ? value.get_int64() : LocaleIndependentAtoi<int64_t>(value.get_str()); + return value.isNull() ? nDefault : value.isFalse() ? 0 : value.isTrue() ? 1 : value.isNum() ? value.getInt<int64_t>() : LocaleIndependentAtoi<int64_t>(value.get_str()); } bool ArgsManager::GetBoolArg(const std::string& strArg, bool fDefault) const |