Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-2224

BSONObjBuilder::append( const StringData& fieldName, string str), second argument should be passed by const&

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.7.4
    • Affects Version/s: None
    • Component/s: Internal Client
    • None

      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&.

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: