diff options
author | jannaerin <golden.janna@gmail.com> | 2017-11-08 10:46:52 -0500 |
---|---|---|
committer | jannaerin <golden.janna@gmail.com> | 2017-12-07 15:57:06 -0500 |
commit | bbebcbfde994ec14b9fabfe17779cfb5adcda211 (patch) | |
tree | 33bfffef16ac967e8e8a9733a0c55aef936c1e0e /src/mongo/db/pipeline/document_source_single_document_transformation.cpp | |
parent | 09da9900b81ac80a422747f934ccc08813590d63 (diff) | |
download | mongo-bbebcbfde994ec14b9fabfe17779cfb5adcda211.tar.gz |
SERVER-24981 Rewrite $limit optimization
Diffstat (limited to 'src/mongo/db/pipeline/document_source_single_document_transformation.cpp')
-rw-r--r-- | src/mongo/db/pipeline/document_source_single_document_transformation.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/mongo/db/pipeline/document_source_single_document_transformation.cpp b/src/mongo/db/pipeline/document_source_single_document_transformation.cpp index d3758128296..f48f5897add 100644 --- a/src/mongo/db/pipeline/document_source_single_document_transformation.cpp +++ b/src/mongo/db/pipeline/document_source_single_document_transformation.cpp @@ -85,9 +85,8 @@ Pipeline::SourceContainer::iterator DocumentSourceSingleDocumentTransformation:: Pipeline::SourceContainer::iterator itr, Pipeline::SourceContainer* container) { invariant(*itr == this); auto nextSkip = dynamic_cast<DocumentSourceSkip*>((*std::next(itr)).get()); - auto nextLimit = dynamic_cast<DocumentSourceLimit*>((*std::next(itr)).get()); - if (nextSkip || nextLimit) { + if (nextSkip) { std::swap(*itr, *std::next(itr)); return itr == container->begin() ? itr : std::prev(itr); } |