[SERVER-6908] Do not pass strings by value, pass by const ref (&) Created: 31/Aug/12  Updated: 11/Jul/16  Resolved: 31/Aug/12

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

Type: Bug Priority: Trivial - P5
Reporter: Tad Marshall Assignee: Tad Marshall
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

We're pretty good about passing const references to strings instead of passing them by value, avoiding a string copy that serves no purpose. But we're not perfect. In code where the called routine doesn't change its local copy of string arguments, we should always use const&.



 Comments   
Comment by auto [ 31/Aug/12 ]

Author:

{u'date': u'2012-08-02T02:55:24-07:00', u'email': u'tad@10gen.com', u'name': u'Tad Marshall'}

Message: SERVER-6908 Don't pass strings by value

Change lots of code to take <string> arguments by const ref instead
of by value; minor changes to surrounding code.
Branch: master
https://github.com/mongodb/mongo/commit/15624a7a7e60ce1f50fc50f6cba54398b2af17d2

Generated at Thu Feb 08 03:13:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.