mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-21 12:22:50 -05:00
refactor: Avoid using IsArgSet() on -debug, -loglevel, and -vbparams list options
This commit does not change behavior, it just drops unnecessary IsArgSet() calls for -debug, -loglevel, and -vbparams options. The calls are unnecessary because GetArgs() already returns empty arrays if these arguments are not specified.
This commit is contained in:
parent
3d1e8ca53a
commit
d05668922a
2 changed files with 0 additions and 6 deletions
|
@ -66,8 +66,6 @@ void ReadRegTestArgs(const ArgsManager& args, CChainParams::RegTestOptions& opti
|
|||
}
|
||||
}
|
||||
|
||||
if (!args.IsArgSet("-vbparams")) return;
|
||||
|
||||
for (const std::string& strDeployment : args.GetArgs("-vbparams")) {
|
||||
std::vector<std::string> vDeploymentParams = SplitString(strDeployment, ':');
|
||||
if (vDeploymentParams.size() < 3 || 4 < vDeploymentParams.size()) {
|
||||
|
|
|
@ -58,7 +58,6 @@ void SetLoggingOptions(const ArgsManager& args)
|
|||
|
||||
util::Result<void> SetLoggingLevel(const ArgsManager& args)
|
||||
{
|
||||
if (args.IsArgSet("-loglevel")) {
|
||||
for (const std::string& level_str : args.GetArgs("-loglevel")) {
|
||||
if (level_str.find_first_of(':', 3) == std::string::npos) {
|
||||
// user passed a global log level, i.e. -loglevel=<level>
|
||||
|
@ -73,13 +72,11 @@ util::Result<void> SetLoggingLevel(const ArgsManager& args)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
util::Result<void> SetLoggingCategories(const ArgsManager& args)
|
||||
{
|
||||
if (args.IsArgSet("-debug")) {
|
||||
const std::vector<std::string> categories = args.GetArgs("-debug");
|
||||
|
||||
// Special-case: Disregard any debugging categories appearing before -debug=0/none
|
||||
|
@ -93,7 +90,6 @@ util::Result<void> SetLoggingCategories(const ArgsManager& args)
|
|||
return util::Error{strprintf(_("Unsupported logging category %s=%s."), "-debug", cat)};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Now remove the logging categories which were explicitly excluded
|
||||
for (const std::string& cat : args.GetArgs("-debugexclude")) {
|
||||
|
|
Loading…
Add table
Reference in a new issue