<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/94929>94929</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
flang/lib/Semantics/expression.cpp:4413: Pointless vector copy ?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
code-quality,
flang:semantics
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dcb314
</td>
</tr>
</table>
<pre>
Static analyser cppcheck says:
flang/lib/Semantics/expression.cpp:4413:31: performance: Function parameter 'oprs' should be passed by const reference. [passedByValue]
Source code is
MaybeExpr ArgumentAnalyzer::TryDefinedOp(
std::vector<const char *> oprs, parser::MessageFixedText error) {
Code that avoids the vector copy is:
MaybeExpr ArgumentAnalyzer::TryDefinedOp(
const std::vector<const char *> & oprs, parser::MessageFixedText error) {
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyck0Fvoz4QxT_NcLEawZgk-MCBJOVW_f9Sq70bMwnedbDXY6Kwn35F2artbbcXkDX2vPfTvNHM9jIS1bA9wPaU6SkNPta96WRRZp3v5_o56WSN0KN2M1MUJgQzkPkhWM8MsoH8BPmf79np8QLYOtsBts901WOyhgFbuodIzNaPGxMCyKYsCwmykQXIRgSKZx-vejS0HNtpNMn6UQQd9ZUSRQG49yEy4F7w4CfXi45E0MzUi24Wxo-cRKQzRRoNbQRsD2v1MH_TbiLYnj4affZTNCSM70lY_lh50nNHj_cQRRMv05XG1CzkvygurLJ5ifOJznak_r8AWK2PhBCCU7_euJFJPoI8rqbMoBf7DchHsSIcFy5-a_hEzPpCrb1T_0L3JChGHwGVgP3ho7PjYjYNOgl987ZnkQYSq5gwPswLyOdxfJlldf43RIC7r1JlfS17JZXOqC72xV6pSlYqG2rsVbXHKtfqbHJJGvfUd5UqSSm9y2WR2RpzLPNdkefbcodqs-uKqjJb7HcaiyInKHO6aus2zt2uGx8vmWWeqFalQpU53ZHj18gjLhF4-DlpZ9MMiIBHQFxzLBt-TzAu6xHrpeFDN10YytxZTvwukWxyVP_7Coj_vR2TI-ZP0wTZZlN09ZBSeB0stoDtxaZh6jbGXxcNd3v7PYTov5NJgO0r6iK40t5q_B0AAP__EXU8kw">