Invert if-condition to improve readability

This commit is contained in:
Stephan van Veen 2019-05-11 13:18:37 +02:00
parent 95746ae159
commit e923cf2ac3

View File

@ -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);