<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/94932>94932</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
flang/lib/Semantics/scope.cpp:59: Suggest avoid pointless copy of a map
</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/scope.cpp:59:44: performance: Function parameter 'symbols' should be passed by const reference. [passedByValue]
Source code is
static std::vector<common::Reference<T>> GetSortedSymbols(
std::map<SourceName, MutableSymbolRef> symbols) {
Suggest new code:
static std::vector<common::Reference<T>> GetSortedSymbols(
const std::map<SourceName, MutableSymbolRef> & symbols) {
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0Uz-T2yoQ_zSrhjmPBMiyChW27_Sq94rzm_SAVjIJEoRFzujbZ2TFuUsmzRVpYGCH35_lt4rIDhNiA-UJyudMzenqY9MZLQqZad8tzSWpZA1Tk3ILYWQmBHNF84WRWgjEEfJnyH-svVPTALx1VgNvLziqKVlDwFsyPuDOhADiWNYgjlKCOLKAsfdxVJPB9djOk0nWTyyoqEZMGBnwipZRe0fAK0ZXP7uOaWRBEWHH9MKMnyixiD1GnAzuGJSnrXpaPik3I5TP70Ve_BwNMuM7ZJbeV2izSqlbfYnjDU3yEcTZ-HH003b5-iACcf4fxAuIF_YPpouPCbvLQ-phQ3zDGlUAcd64_1MjAj-zf-ektMPt0Sv2K9RPszWD6vSL7nkYkBKb8Ntd_G-9_wvit85-2ALw_R9tZF0julrUKsOmqIqqrg91kWfXpq-kkj1KuRfyILUWGpXWRb2vD6glqsw2POcy3xd5XpZlke_2xZ7zutdYVUagKUHmOCrrds7dxp2PQ2aJZmxqWQueOaXR0T3jnK-te_o6K2fTApwDPwPnW3DFkd4iy9d5iM0K-KTngUDmzlKiN4pkk8PmA5lnjy9UN287FrydkkMiZnxYmO-ZYqMK2Rxdc00p3KeLt8DbwabrrHfGjyuRuz22pxD9ZzQJeHv3u7Julm8N_x4AAP__7Io5Sg">