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

    <tr>
        <th>Summary</th>
        <td>
            llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h: 2 * pointless copy 
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            code-quality,
            debuginfo
      </td>
    </tr>

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

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

<pre>
    Static analyser cppcheck says:

trunk/llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h:215:52: performance: Function parameter 'LHS' should be passed by const reference. [passedByValue]
trunk/llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h:216:52: performance: Function parameter 'RHS' should be passed by const reference. [passedByValue]

Source code is

  static bool isEqual(codeview::GloballyHashedType LHS,
 codeview::GloballyHashedType RHS) {

Maybe better code:

  static bool isEqual( const codeview::GloballyHashedType & LHS,
 const codeview::GloballyHashedType & RHS) {

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysk0FvnDwQhn_NcBllBWO8wIHDbvbjS6X20lS5GzO7uPFiaptU_PvKu5ESRarSqrlYApuZ5zHvqBDMaWJuQe5BHjK1xNH5dtC9KMqsd8Pa3kcVjUY1KbsG9qjnWY-sHzGoNYDYQX6A_HmNfpkegTprn85AnZm0XQZ-eXHgfjl9mo4OqLt1Az8Y_gnUfVtnvlNhNNNpM4LYUSFB7CSB2OHM_uj8WU2a02O3TDoaN-GsvDpzZI9A1ee7e6AKw-gWO2DPOKsQeMB-Re2mENHzkT1PmjcIcn_d3a8Pyi4M8vDB8Nu_g__6EfDX9d4tXjNqNzCa8HoHMVz_Y--cRRP--7EoC1Sno09JROxA7P63rlfWrsmHh2SGl6u9fS7y7umLS4NQ7V83_6LWnrHnmIxTjTex-R3cs_-7XYG2bzn_-Lu3xNnQiqERjcq4LaqiklSWosnGloq6qOiY1_VWCiVFyf3QaKGr5tg0w7bKTEs5lfk2L4s6rwq5kUcquNrKus65qUsJZc5nZewmBWrj_CkzISzcNqWoZWZVzzZcBpEood-kWzBxBaJkRjSkAJpLACkNq29ToZt-OQUoc2tCDC-lo4mW23_MMhIC7XB2ZoqWQ0Dt5hWzxdt2jHG-jD91QN3JxHHpN9qdX3pc4GbvvrOOiSG5BqDuqvvU0q8AAAD__4zSbeU">