mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-04 07:04:39 +00:00
Invert if-condition to improve readability
This commit is contained in:
parent
95746ae159
commit
e923cf2ac3
@ -314,10 +314,10 @@ class ArgumentParser {
|
||||
Argument& add_argument(Targs... Fargs) {
|
||||
std::shared_ptr<Argument> tArgument = std::make_shared<Argument>(std::move(Fargs)...);
|
||||
|
||||
if (!tArgument->mIsOptional)
|
||||
mPositionalArguments.emplace_back(tArgument);
|
||||
else
|
||||
if (tArgument->mIsOptional)
|
||||
mOptionalArguments.emplace_back(tArgument);
|
||||
else
|
||||
mPositionalArguments.emplace_back(tArgument);
|
||||
|
||||
for (auto& mName : tArgument->mNames) {
|
||||
mArgumentMap.insert_or_assign(mName, tArgument);
|
||||
|
Loading…
Reference in New Issue
Block a user