diff options
author | Mathias Stearn <mathias@10gen.com> | 2017-06-09 19:20:07 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2017-06-19 17:08:35 -0400 |
commit | 1babec6a705c242628a765935ac9d98b56a41218 (patch) | |
tree | 1b917e39f921cce0a2cd41db170ea6c22e6348bc /src/mongo/scripting | |
parent | a9a849b21ced693f2345d4507ee14541818244d9 (diff) | |
download | mongo-1babec6a705c242628a765935ac9d98b56a41218.tar.gz |
SERVER-29564 BSONObjBuilder can now be seeded with a BSONObj prefix
This will avoid copying whenever it is safe.
Diffstat (limited to 'src/mongo/scripting')
-rw-r--r-- | src/mongo/scripting/mozjs/mongo.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/mongo/scripting/mozjs/mongo.cpp b/src/mongo/scripting/mozjs/mongo.cpp index 5e2c2236fc9..e8399fd10d8 100644 --- a/src/mongo/scripting/mozjs/mongo.cpp +++ b/src/mongo/scripting/mozjs/mongo.cpp @@ -583,9 +583,7 @@ void MongoBase::Functions::copyDatabaseWithSCRAM::call(JSContext* cx, JS::CallAr status = session->step(payload, &responsePayload); uassertStatusOK(status); - BSONObjBuilder commandBuilder; - - commandBuilder.appendElements(saslCommandPrefix); + BSONObjBuilder commandBuilder(std::move(saslCommandPrefix)); commandBuilder.appendBinData(saslCommandPayloadFieldName, static_cast<int>(responsePayload.size()), BinDataGeneral, |