[SERVER-68885] Coverity analysis defect 123452: AUTO_CAUSES_COPY Created: 17/Aug/22 Updated: 27/Oct/23 Resolved: 30/Aug/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Coverity Collector User | Assignee: | Backlog - Query Execution |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | coverity, neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Assigned Teams: |
Query Execution
|
| Participants: |
| Description |
|
AUTO_CAUSES_COPY Unnecessary object copies can affect performance. Using the auto keyword without an & causes a copy. |
| Comments |
| Comment by Kyle Suarez [ 30/Aug/22 ] |
|
After a lengthy discussion in #cxx-discuss we have concluded that because BSONElement is trivially copiable and <= 16 bytes, it will be passed via registers on all the relevant calling conventions. Closing this as "works as designed". |