diff options
author | Anton Korshunov <anton.korshunov@mongodb.com> | 2019-03-15 12:54:10 +0000 |
---|---|---|
committer | Anton Korshunov <anton.korshunov@mongodb.com> | 2019-03-16 14:18:52 +0000 |
commit | 6161eb7b7aff5305b445dcdd20825f041b5e5a68 (patch) | |
tree | da81b224c548e985780a32728df6547015abd149 /src/mongo/db/pipeline | |
parent | 9f5b13ee93e7eaeafa97ebd1d2d24c66b93cc974 (diff) | |
download | mongo-6161eb7b7aff5305b445dcdd20825f041b5e5a68.tar.gz |
SERVER-40153 size_t on arm32 is not 64 bit
Diffstat (limited to 'src/mongo/db/pipeline')
-rw-r--r-- | src/mongo/db/pipeline/document_source_sort.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/mongo/db/pipeline/document_source_sort.cpp b/src/mongo/db/pipeline/document_source_sort.cpp index 9f9832fd961..256cbf0edf1 100644 --- a/src/mongo/db/pipeline/document_source_sort.cpp +++ b/src/mongo/db/pipeline/document_source_sort.cpp @@ -201,17 +201,13 @@ Pipeline::SourceContainer::iterator DocumentSourceSort::doOptimizeAt( Pipeline::SourceContainer::iterator itr, Pipeline::SourceContainer* container) { invariant(*itr == this); - using SumType = long long; - // Just in case, since we're passing an address of a signed 64bit below. - static_assert(std::is_signed<SumType>::value && sizeof(SumType) == 8); - auto stageItr = std::next(itr); - SumType skipSum = 0; + int64_t skipSum = 0; while (stageItr != container->end()) { auto nextStage = (*stageItr).get(); auto nextSkip = dynamic_cast<DocumentSourceSkip*>(nextStage); auto nextLimit = dynamic_cast<DocumentSourceLimit*>(nextStage); - SumType safeSum = 0; + int64_t safeSum = 0; // The skip and limit values can be very large, so we need to make sure the sum doesn't // overflow before applying an optimiztion to pull the limit into the sort stage. |