[SERVER-75019] Coverity analysis defect 135400: AUTO_CAUSES_COPY Created: 19/Mar/23  Updated: 29/Oct/23  Resolved: 23/Mar/23

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

Type: Improvement Priority: Minor - P4
Reporter: Coverity Collector User Assignee: Amr Elhelw
Resolution: Fixed Votes: 0
Labels: coverity, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Execution
Backwards Compatibility: Fully Compatible
Participants:

 Description   

AUTO_CAUSES_COPY

Unnecessary object copies can affect performance. Using the auto keyword without an & causes a copy.
/src/mongo/db/exec/sbe/values/value_printer.cpp:547: AUTO_CAUSES_COPY 135400 Using the "auto" keyword without an "&" causes the copy of an object of type pair.



 Comments   
Comment by Githook User [ 22/Mar/23 ]

Author:

{'name': 'Amr Elhelw', 'email': 'amr.elhelw@mongodb.com', 'username': 'aelhelw'}

Message: SERVER-75019 Use const& to avoid making copies
Branch: master
https://github.com/mongodb/mongo/commit/5767f6d16fbd191e3ebc3d0b929b398774a80fb6

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