[SERVER-68814] Coverity analysis defect 122635: AUTO_CAUSES_COPY Created: 14/Aug/22  Updated: 29/Oct/23  Resolved: 19/Aug/22

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

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Didier Nadeau
Resolution: Fixed Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Server Serverless 2022-08-22
Participants:

 Description   

AUTO_CAUSES_COPY

Unnecessary object copies can affect performance. Using the auto keyword without an & causes a copy.
/src/mongo/db/serverless/shard_split_donor_op_observer.cpp:179: AUTO_CAUSES_COPY 122635 Using the "auto" keyword without an "&" causes the copy of an object of type StringData.



 Comments   
Comment by Githook User [ 19/Aug/22 ]

Author:

{'name': 'Didier Nadeau', 'email': 'didier.nadeau@mongodb.com', 'username': 'nadeaudi'}

Message: SERVER-68814 Use auto&& in split observer range-based for loops
Branch: master
https://github.com/mongodb/mongo/commit/aadd70eef054d7a0fdb557b557c1cb7c108c52a5

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