Info
Test always evaluates the same
Defect 102259 (STATIC_C)
Checker DEADCODE (subcategory redundant_test)
File: /src/mongo/db/pipeline/document_source_sort.cpp
Function mongo::DocumentSourceSort::doOptimizeAt(std::List_iterator>, std::_cxx11::list, std::allocator>> *)
/src/mongo/db/pipeline/document_source_sort.cpp, line: 206
At condition "nextSkip", the value of "nextSkip" must be "NULL".
} else if (!nextStage->constraints().canSwapWithLimit && !nextSkip) {
/src/mongo/db/pipeline/document_source_sort.cpp, line: 197
Condition "nextSkip", taking false branch. Now the value of "nextSkip" is "NULL".
if (auto nextSkip = dynamic_cast(nextStage)) {
/src/mongo/db/pipeline/document_source_sort.cpp, line: 206
The condition "!nextSkip" must be true.
} else if (!nextStage->constraints().canSwapWithLimit && !nextSkip) {
Top User Comments
xgen-internal-githook commented on Fri, 29 Dec 2017 20:00:03 +0000:
Author:
{'name': 'David Storch', 'username': 'dstorch', 'email': 'david.storch@10gen.com'}
Message: SERVER-32221 Remove unnecessary null check in DocumentSourceSort.
Branch: master
https://github.com/mongodb/mongo/commit/4af16ae93ff1de3597ba36c6b7539fa851387b48
david.storch commented on Fri, 8 Dec 2017 15:27:47 +0000:
kyle.suarez, yeah, I think it's worth cleaning this up while it's fresh in our heads. It looks like a trivial fix. Assigning to you for next sprint.
kyle.suarez commented on Fri, 8 Dec 2017 14:07:39 +0000:
charlie.swanson, want me to take a look at this? This is code committed by Janna.