<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/95092>95092</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
llvm/include/llvm/Support/Caching.h:31: Pointless string copy ?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
code-quality,
llvm:support
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dcb314
</td>
</tr>
</table>
<pre>
Static analyser cppcheck says:
llvm/include/llvm/Support/Caching.h:31:32: performance: Function parameter 'OSPath' should be passed by const reference. [passedByValue]
Source code is
CachedFileStream(std::unique_ptr<raw_pwrite_stream> OS,
std::string OSPath = "")
Maybe use a StringRef or a constant reference.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycks1u4zgMx59GvhANZMlu7IMPabK-LVqsgb0WtMTEmlEkVx8t_PYDO5lpzgMYBEyKHz_yjzGaiyPqWP3C6lOBOU0-dFqNsqyK0eulGxImowAd2iVSADXPaiL1EyIukckD4yfG79bazysTvXHKZk1M9HfHkOfZh8REf0Q1GXfZTUweZLkaweQBZgpnH67oFK2_fXYqGe9gxoBXShSAif3r8IZpYmIPcfLZahgJZoyRNIwLKO9igkBnCuQU7YDVL7foy_I_2kysPj3OOvgcFIHymsDExwisQ5LujaUhBcIrE01MemWVh-zMR6b3OQUmjwG_3uevYBK9x9tL-Q-8Dkwc75X-pMUUjLvADQGYPAETYvvax9b_4jIS5EiAMGwp_9EZfAC88aF7RLzlFLqTupUtFtSV-7LhbdPWvJg62j_XdV02pSzPvKEGx31ZUTW2qOuWn7EwneCi4s9lydtKSL7TXPJS7xtCLjk-V6zidEVjd-sddz5cChNjpq6teSsKiyPZuElHiHWPTx8ZrUnLxnVkQmznl4f4-_xi1VjoVvfTmC-RVdyamOJ3_WSSpe4vdARv3rhkKUa471r5eQEm-yIH200pzZtaRc9EfzFpyuNO-et37W2oOfgfpNYGG2hkor-xfnbiVwAAAP__ebkAvg">