[SERVER-68897] Coverity analysis defect 122701: AUTO_CAUSES_COPY Created: 17/Aug/22  Updated: 14/Feb/23  Resolved: 06/Sep/22

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 6.2.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Coverity Collector User Assignee: Colin Stolley
Resolution: Done Votes: 0
Labels: coverity, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2022-08-17 at 10.15.46 AM.png    
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_exchange.cpp:409: AUTO_CAUSES_COPY 122701 Using the "auto" keyword without an "&" causes the copy of an object of type BSONElement.



 Comments   
Comment by Githook User [ 06/Sep/22 ]

Author:

{'name': 'Colin Stolley', 'email': 'colin.stolley@mongodb.com', 'username': 'ccstolley'}

Message: SERVER-68897: Avoid copy in for loop
Branch: master
https://github.com/mongodb/mongo/commit/2e4fe82c3d264917757e9738cf9bfd5d05181a55

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