mirror of https://github.com/jarro2783/cxxopts.git
Move `result` up and return it
This allows `gcc` to elide the copy in the return and keeps it from warning with `-Wnvro` enabled.
This commit is contained in:
parent
dbf4c6a668
commit
1a6926f4e0
|
|
@ -2776,18 +2776,18 @@ Options::help_one_group(const std::string& g) const
|
|||
{
|
||||
using OptionHelp = std::vector<std::pair<String, String>>;
|
||||
|
||||
String result;
|
||||
|
||||
auto group = m_help.find(g);
|
||||
if (group == m_help.end())
|
||||
{
|
||||
return "";
|
||||
return result;
|
||||
}
|
||||
|
||||
OptionHelp format;
|
||||
|
||||
std::size_t longest = 0;
|
||||
|
||||
String result;
|
||||
|
||||
if (!g.empty())
|
||||
{
|
||||
result += toLocalString(" " + g + " options:\n");
|
||||
|
|
|
|||
Loading…
Reference in New Issue