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&

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 1.7.4
    • None
    • Internal Client
    • None

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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: