Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-32221

Coverity analysis defect 102259: Redundant test

    • Fully Compatible
    • ALL
    • Query 2018-01-01, Query 2018-01-15

      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<boost::intrusive_ptr<mongo::DocumentSource>>, std::_cxx11::list<boost::intrusive_ptr<mongo::DocumentSource>, std::allocator<boost::intrusive_ptr<mongo::DocumentSource>>> *)
      /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<DocumentSourceSkip*>(nextStage)) {
      

      /src/mongo/db/pipeline/document_source_sort.cpp, line: 206
      The condition "!nextSkip" must be true.

                  } else if (!nextStage->constraints().canSwapWithLimit && !nextSkip) {
      

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: