summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document_source_internal_unpack_bucket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/pipeline/document_source_internal_unpack_bucket.cpp')
-rw-r--r--src/mongo/db/pipeline/document_source_internal_unpack_bucket.cpp2
1 files changed, 1 insertions, 1 deletions
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.