diff options
-rw-r--r-- | src/mongo/db/commands/write_commands.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/commands/write_commands.cpp b/src/mongo/db/commands/write_commands.cpp index 5a034bc922a..c8d3d45fee0 100644 --- a/src/mongo/db/commands/write_commands.cpp +++ b/src/mongo/db/commands/write_commands.cpp @@ -1225,9 +1225,9 @@ public: return false; } - const auto& insertResult = swResult.getValue(); - const auto& batch = insertResult.batch; - batches.emplace_back(batch, index); + auto& insertResult = swResult.getValue(); + batches.emplace_back(std::move(insertResult.batch), index); + const auto& batch = batches.back().first; if (isTimeseriesWriteRetryable(opCtx)) { stmtIds[batch->bucket().id].push_back(stmtId); } |