[SERVER-2224] BSONObjBuilder::append( const StringData& fieldName, string str), second argument should be passed by const& Created: 14/Dec/10 Updated: 12/Jul/16 Resolved: 15/Dec/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Client |
| Affects Version/s: | None |
| Fix Version/s: | 1.7.4 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Andrew Morrow (Inactive) | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
The overload of BSONObjBuilder::append that takes a std::string as its second argument takes the string by value, forcing a needless copy. https://github.com/mongodb/mongo/blob/master/bson/bsonobjbuilder.h#L379 The string should be passed by const&. |
| Comments |
| Comment by auto [ 15/Dec/10 ] |
|
Author: {u'login': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}Message: BONObjBuilder::append( const StringData& fieldName, string str), second argument should be passed by const& |