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:
Christoph Weiss 2025-03-20 17:23:49 +01:00
parent dbf4c6a668
commit 1a6926f4e0
1 changed files with 3 additions and 3 deletions

View File

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