https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88811

            Bug ID: 88811
           Summary: libstdc++-v3/src/filesystem/path.cc:503: possible
                    cut'n'paste error ?
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

trunk/libstdc++-v3/src/filesystem/path.cc:503] ->
[trunk/libstdc++-v3/src/filesystem/path.cc:509]: (style) The if condition is
the same as the previous if condition

Source code is

  if (!pstr1.empty())
    {
      w += " [";
      w += pstr1;
      w += ']';
    }
  if (!pstr1.empty())
    {
      w += " [";
      w += pstr2;
      w += ']';
    }

Maybe better code

  if (!pstr1.empty())
    {
      w += " [";
      w += pstr1;
      w += ']';
    }
  if (!pstr2.empty())
    {
      w += " [";
      w += pstr2;
      w += ']';
    }

Reply via email to