summaryrefslogtreecommitdiff
path: root/src/mongo/db/dbmessage.h
diff options
context:
space:
mode:
authorAdam Midvidy <amidvidy@gmail.com>2015-10-22 10:34:51 -0400
committerAdam Midvidy <amidvidy@gmail.com>2015-10-30 15:47:26 -0400
commit791c412874ce87d9cc1eac75edce8116a9d40640 (patch)
treecdaaeaefd1d093d88ff9a5332a68a8e440b124fa /src/mongo/db/dbmessage.h
parente62e2e71eff397caf22a0da13ac4669a8546b298 (diff)
downloadmongo-791c412874ce87d9cc1eac75edce8116a9d40640.tar.gz
SERVER-20609 do not heap allocate Message
Diffstat (limited to 'src/mongo/db/dbmessage.h')
-rw-r--r--src/mongo/db/dbmessage.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/mongo/db/dbmessage.h b/src/mongo/db/dbmessage.h
index aa74fd59ffb..2f0c6b6645b 100644
--- a/src/mongo/db/dbmessage.h
+++ b/src/mongo/db/dbmessage.h
@@ -312,16 +312,11 @@ public:
* A response to a DbMessage.
*/
struct DbResponse {
- Message* response;
+ Message response;
MSGID responseTo;
std::string exhaustNS; /* points to ns if exhaust mode. 0=normal mode*/
- DbResponse(Message* r, MSGID rt) : response(r), responseTo(rt) {}
- DbResponse() {
- response = 0;
- }
- ~DbResponse() {
- delete response;
- }
+ DbResponse(Message r, MSGID rt) : response(std::move(r)), responseTo(rt) {}
+ DbResponse() = default;
};
void replyToQuery(int queryResultFlags,