summaryrefslogtreecommitdiff
path: root/src/mongo/db/update/document_diff_applier.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/update/document_diff_applier.cpp')
-rw-r--r--src/mongo/db/update/document_diff_applier.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/update/document_diff_applier.cpp b/src/mongo/db/update/document_diff_applier.cpp
index ec592ef3363..7620a756064 100644
--- a/src/mongo/db/update/document_diff_applier.cpp
+++ b/src/mongo/db/update/document_diff_applier.cpp
@@ -455,7 +455,7 @@ int32_t computeDamageOnArray(const BSONObj& preImageRoot,
nextMod = reader->next();
} else {
// This field is not mentioned in the diff so we pad the post image with null.
- auto idxAsStr = std::to_string(idx);
+ const auto idxAsStr = std::to_string(idx);
// The end of 'arrayPreImage' with the offset from the updates made already.
auto targetOffset = targetOffsetInPostImage(
arrayPreImage.end()->rawdata(), preImageRoot.objdata(), offsetRoot, diffSize);
@@ -464,7 +464,7 @@ int32_t computeDamageOnArray(const BSONObj& preImageRoot,
appendDamage(damages, bufBuilder->len(), sourceSize, targetOffset, 0);
diffSize += sourceSize;
appendTypeByte(bufBuilder, BSONType::jstNULL);
- bufBuilder->appendStr(idxAsStr);
+ bufBuilder->appendCStr(idxAsStr);
}
}