[SERVER-68987] Coverity analysis defect 122769: AUTO_CAUSES_COPY Created: 19/Aug/22  Updated: 27/Oct/23  Resolved: 25/Feb/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Coverity Collector User Assignee: Backlog - Query Optimization
Resolution: Gone away Votes: 0
Labels: coverity, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2022-08-19 at 10.48.40 AM.png    
Assigned Teams:
Query Optimization
Participants:

 Description   

AUTO_CAUSES_COPY

Unnecessary object copies can affect performance. Using the auto keyword without an & causes a copy.
/src/mongo/db/pipeline/document_source_lookup.cpp:1017: AUTO_CAUSES_COPY 122769 Using the "auto" keyword without an "&" causes the copy of an object of type LetVariable.



 Comments   
Comment by Amr Elhelw [ 25/Feb/23 ]

Looks like this has already been fixed a while back, namely by: https://github.com/mongodb/mongo/commit/bc998019c79c83db140317c3e59761fdd12a8c5f

Generated at Thu Feb 08 06:12:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.