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

    <tr>
        <th>Summary</th>
        <td>
            llvm/include/llvm/Object/ELFTypes.h: 2 * pointless object copy ?
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            code-quality,
            llvm
      </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/Object/ELFTypes.h:720:42: performance: Function parameter 'Other' should be passed by const reference. [passedByValue]

Source code is

  bool operator==(Elf_Note_Iterator_Impl Other) const {

Suggest new code:

  bool operator==( const Elf_Note_Iterator_Impl & Other) const {

2.

llvm/include/llvm/Object/ELFTypes.h:727:42: performance: Function parameter 'Other' should be passed by const reference. [passedByValue]

Duplicate a few lines further down.


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEk89q20AQxp9mdBkipJFkWQcd7DqCQGkOKb2G1WpkbbvWbvdPgt6-yDbEKYRSeigsC7OzzO-b-RjhvTrOzC1Ue6gOiYhhMq4dZF_kZdKbYWmfgghKopiFXjw7lNbKieUP9GLxUOwgO0B2vfP0NtL65QTUqVnqODBQd3147L-zDEDd_efu62LZpxMUu5oyKHYlQbFDy2407iRmyWvYxVkGZWa0wokTB3YIVD-GiR1QjX4yUQ_YM1rhPQ_YLyjN7AM6HtnxLDlFqPaX7H75JnRkqA63Wp9MdJJRmoFR-dsMYm-MRmPZiWAcFIf10PZej89fTODnh3DJPD-crMarquaqAOr9O0w8HtkHnPn1zPptfh-xrsU-QAJt_oClf_Kl_o--HKLVSorAKHDkV9RqZo9jdCsEB_M6v2stGdpiaIpGJNzmdb7Nmm1eFsnUbkrqRbXlelPnom5GyflQ0DBUNeVVVtWJaimjMtvkedZQk1G6LYdcNqVsqrGsqSyhzPgklE7XaaXGHRPlfeS2qbImS7ToWfvzGhGtzt79jEKrsAAR0CcgugyZ1i1z7Rrc9fHoocy08sG_VQ0qaG7_ziMkBNqhNWoOmr1Hc_6G0tgFoeiS6HQ7hWDPC0sdUHdUYYp9Ks3prfhZlXXmijj354G6S4svLf0KAAD__3ONTrA">