mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
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-
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user