summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/pipeline')
-rw-r--r--src/mongo/db/pipeline/document_source_densify.cpp2
-rw-r--r--src/mongo/db/pipeline/document_source_internal_unpack_bucket.cpp2
-rw-r--r--src/mongo/db/pipeline/expression.h2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/pipeline/document_source_densify.cpp b/src/mongo/db/pipeline/document_source_densify.cpp
index 2fd25d5c3ca..addddc34708 100644
--- a/src/mongo/db/pipeline/document_source_densify.cpp
+++ b/src/mongo/db/pipeline/document_source_densify.cpp
@@ -152,7 +152,7 @@ list<intrusive_ptr<DocumentSource>> createFromBsonInternal(
list<FieldPath> partitions;
if (spec.getPartitionByFields()) {
auto partitionFields = (*spec.getPartitionByFields());
- for (auto partitionField : partitionFields)
+ for (auto& partitionField : partitionFields)
partitions.push_back(FieldPath(partitionField));
}
diff --git a/src/mongo/db/pipeline/document_source_internal_unpack_bucket.cpp b/src/mongo/db/pipeline/document_source_internal_unpack_bucket.cpp
index 871a81df95a..d4d38a2b2be 100644
--- a/src/mongo/db/pipeline/document_source_internal_unpack_bucket.cpp
+++ b/src/mongo/db/pipeline/document_source_internal_unpack_bucket.cpp
@@ -941,7 +941,7 @@ bool DocumentSourceInternalUnpackBucket::optimizeLastpoint(Pipeline::SourceConta
auto isSortValidForGroup = [&](AccumulatorDocumentsNeeded targetAccum) {
bool firstpointTimeIsAscending =
(targetAccum == AccumulatorDocumentsNeeded::kFirstDocument);
- for (auto entry : sortStage->getSortKeyPattern()) {
+ for (const auto& entry : sortStage->getSortKeyPattern()) {
auto isTimeField = entry.fieldPath->fullPath() == timeField;
if (isTimeField && (entry.isAscending == firstpointTimeIsAscending)) {
// This is a first-point query, which is disallowed.
diff --git a/src/mongo/db/pipeline/expression.h b/src/mongo/db/pipeline/expression.h
index 4680181b295..918173b50ba 100644
--- a/src/mongo/db/pipeline/expression.h
+++ b/src/mongo/db/pipeline/expression.h
@@ -559,7 +559,7 @@ public:
// Verify that '_output' produces an array and pass each element to 'process'.
auto output = _output->evaluate(root, variables);
uassert(5788200, "Input must be an array", output.isArray());
- for (auto item : output.getArray()) {
+ for (auto& item : output.getArray()) {
accum.process(item, false);
}
return accum.getValue(false);