[SERVER-68996] Coverity analysis defect 123166: AUTO_CAUSES_COPY Created: 19/Aug/22  Updated: 29/Oct/23  Resolved: 05/Oct/22

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

Type: Improvement Priority: Minor - P4
Reporter: Coverity Collector User Assignee: Alyssa Clark
Resolution: Fixed 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 11.18.05 AM.png    
Backwards Compatibility: Fully Compatible
Sprint: QE 2022-10-03, QE 2022-10-17
Participants:

 Description   

AUTO_CAUSES_COPY

Unnecessary object copies can affect performance. Using the auto keyword without an & causes a copy.
/src/mongo/db/exec/geo_near.cpp:921: AUTO_CAUSES_COPY 123166 Using the "auto" keyword without an "&" causes the copy of an object of type S2CellId.



 Comments   
Comment by Githook User [ 05/Oct/22 ]

Author:

{'name': 'Alyssa Wagenmaker', 'email': 'alyssa.wagenmaker@mongodb.com', 'username': 'awagenmaker'}

Message: SERVER-68996 change variable to const reference to avoid copy
Branch: master
https://github.com/mongodb/mongo/commit/fed2a61d2bfaaaa5183caa2d67df5b68d27e4080

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