<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/94930>94930</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
llvm/lib/ObjCopy/ELF/ELFObject.h:913: Pointless 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:
llvm/lib/ObjCopy/ELF/ELFObject.h:913:33: performance: Function parameter 'Rel' should be passed by const reference. [passedByValue]
Source code is
void addRelocation(Relocation Rel) { Relocations.push_back(Rel); }
Suggest new code:
void addRelocation( const Relocation & Rel) { Relocations.push_back(Rel); }
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyckstu2zwQhZ9mtBlEkIaWZS20iJNfqx9IkQDdFryMLSa0qPKSQm9fSA4Qt0AX7WaA4ZBzziE-GaM9T8w9NEdoHguZ0-hDb7QS9a5Q3iz9S5LJapSTdEvkgHqe9cj6DaNcIoh7qB6h-qjOvV-ABmcV0PCkXh_8vAAN__0_XOuTemWdyhHEfVcLEPdiLThzOPlwkZPmtR3ypJP1E84yyAsnDgjUPrMDajGOPjuDinGWMbJBtaD2U0wY-MSBJ80lQnO8To_LV-kyQ_N4a_PF56AZtTeMNt5OEN-9NSiNeWbntVxtAB0-G9xsdAjtET9PYznnOH5TUr9dbwN1II4I7a-6-XzmmHDiH5v4b7_3B_GPeDcegPb_6KMwvTCd6GTBfd3WbdcdWmqLsd83SgjSWpDQpq6UIH2qD0qrvWzoIExhe6poV-3rqmoaqtrytDeCTq3u9rVum66BXcUXaV25QlD6cC5sjJn7bteJqnBSsYsbZkRr9rvvWTqbFiACegCiKzu0Uhj6tblT-RxhVzkbU_zcmmxy3P81afjF2yk5jhG1nxcEMRQ5uH5Mad4wpvXl2aYxq1L7bfmHxuplDn5dCDRsqSLQcA323tPPAAAA__-_HgPJ">