[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: Change lots of code to take <string> arguments by const ref instead |