[clang-tidy] don't use else after return

Found with readability-else-after-return

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2020-05-09 17:41:32 -07:00
parent cbf8ecd4dc
commit 24678f9fee
No known key found for this signature in database
GPG Key ID: 36D31CFA845F0E3B

View File

@ -901,11 +901,8 @@ namespace cxxopts
{ {
return *m_result; return *m_result;
} }
else
{
return *m_store; return *m_store;
} }
}
protected: protected:
std::shared_ptr<T> m_result; std::shared_ptr<T> m_result;
@ -1657,10 +1654,7 @@ OptionAdder::operator()
{ {
return std::make_tuple(long_.str(), short_.str()); return std::make_tuple(long_.str(), short_.str());
} }
else
{
return std::make_tuple(short_.str(), long_.str()); return std::make_tuple(short_.str(), long_.str());
}
}(short_match, long_match); }(short_match, long_match);
m_options.add_option m_options.add_option
@ -1766,23 +1760,14 @@ ParseResult::consume_positional(std::string a)
++m_next_positional; ++m_next_positional;
return true; return true;
} }
else
{
++m_next_positional; ++m_next_positional;
continue; continue;
} }
}
else
{
add_to_option(*m_next_positional, a); add_to_option(*m_next_positional, a);
return true; return true;
} }
}
else
{
throw_or_mimic<option_not_exists_exception>(*m_next_positional); throw_or_mimic<option_not_exists_exception>(*m_next_positional);
} }
}
return false; return false;
} }
@ -1882,12 +1867,9 @@ ParseResult::parse(int& argc, char**& argv)
{ {
continue; continue;
} }
else
{
//error //error
throw_or_mimic<option_not_exists_exception>(name); throw_or_mimic<option_not_exists_exception>(name);
} }
}
auto value = iter->second; auto value = iter->second;
@ -1923,12 +1905,9 @@ ParseResult::parse(int& argc, char**& argv)
++current; ++current;
continue; continue;
} }
else
{
//error //error
throw_or_mimic<option_not_exists_exception>(name); throw_or_mimic<option_not_exists_exception>(name);
} }
}
auto opt = iter->second; auto opt = iter->second;