<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/90323>90323</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            llvm/include/llvm/Analysis/DOTGraphTraitsPass.h: 2 * clumsy string resize ?
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            code-quality,
            llvm:analysis
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          dcb314
      </td>
    </tr>
</table>

<pre>
    Static analyser cppcheck says:

1.

llvm/include/llvm/Analysis/DOTGraphTraitsPass.h:91:8: performance: Ineffective call of function 'substr' because a prefix of the string is assigned to itself. Use resize() or pop_back() instead. [uselessCallsSubstr]

Source code is

  FN = FN.substr(0, len);

2.

llvm/include/llvm/Analysis/DOTGraphTraitsPass.h:96:12: performance: Ineffective call of function 'substr' because a prefix of the string is assigned to itself. Use resize() or pop_back() instead. [uselessCallsSubstr]

Source code is

      FN = FN.substr(0, --len);


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcVMFu3DgM_Rr6QowhU3bGPvjgZODFXrILJHteyDI9VqOxXVEOOv36wpNJM4f2UvRUHQSQIvT43hNlRNxxYq6huIfikJg1jnOoe9vpLE-6uT_XT9FEZ9FMxp-FA9plsSPbFxRzFtANqAOo656lt5H3ryeg1k3Wrz0DtddEc7nKCVB7-Of5r2CW8TkYF-VfI5KOoJsqA92UoBtcOAxzOJnJ8hb-PfEwsI3uldEa73EecFgnG908IdBe1k5iANpjx9aswmhwCTy4L1tlHBklBjcd0QleufcYZ3RR2A8p_ieMgcV9ZaASqMI54DIv_3fGvlwzbpLIpk8RivtV2LPIg_Fent6gi8OtBE_zGiyjnXtGJ7cniO0jgj5g-5i-d10qoAf0PAFVoO9vy-l3KXsHusnoD5d2Wz-Td7f7ocBJX-u-0pVJuM72WU6qKDQlY110hdrnlbobSJVdZXrVq153RCbvqy6vEleTolzltFdlRhmlhuxdXmhV6krrfWkhV3wyzqebS-kcjokTWbmulCadeNOxl8sAEm1sdp9X4108AxHQAxBdzNWN-W4ubaMa6i2_69ajQK68kygfANFFz_WvPxMkBGrQ-vUk53dj39xD0G2yBl-PMS6XD4BaoPbo4rh2qZ1PHziXBpcwf2Ibtz421hvohfi3AAAA__-Jf2gW">