diff options
Diffstat (limited to 'src/mongo/util/net')
-rw-r--r-- | src/mongo/util/net/op_msg.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mongo/util/net/op_msg.h b/src/mongo/util/net/op_msg.h index dc8037146be..e32b370d5d2 100644 --- a/src/mongo/util/net/op_msg.h +++ b/src/mongo/util/net/op_msg.h @@ -109,12 +109,11 @@ struct OpMsgRequest : public OpMsg { } static OpMsgRequest fromDBAndBody(StringData db, - const BSONObj& body, + BSONObj body, const BSONObj& extraFields = {}) { OpMsgRequest request; request.body = ([&] { - BSONObjBuilder bodyBuilder; - bodyBuilder.appendElements(body); + BSONObjBuilder bodyBuilder(std::move(body)); bodyBuilder.appendElements(extraFields); bodyBuilder.append("$db", db); return bodyBuilder.obj(); |