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

Coverity analysis defect 116487: Redundant test

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Index Maintenance
    • ALL
    • Execution Team 2021-06-28

      Redundant test

      By the time the program execution reaches the test of this condition there is only one possible outcome for the test. The code at the destination of this branch is not dead, either because this condition is always true or because there is at least one other branch that reaches it. Test always evaluates the same
      /src/mongo/db/catalog/multi_index_block.cpp:1027: DEADCODE 116487 Condition "compatible", taking true branch. Now the value of "compatible" is equal to 1.
      /src/mongo/db/catalog/multi_index_block.cpp:1024: DEADCODE 116487 At condition "compatible", the value of "compatible" must be equal to 1.
      /src/mongo/db/catalog/multi_index_block.cpp:1024: DEADCODE 116487 Assigning: "compatible" = "compatible && descriptor->keyPattern()->isPrefixOf(candidateDescriptor->keyPattern(), mongo::SimpleBSONElementComparator::kInstance)".
      /src/mongo/db/catalog/multi_index_block.cpp:1021: DEADCODE 116487 Assigning: "compatible" = "true".
      /src/mongo/db/catalog/multi_index_block.cpp:1024: DEADCODE 116487 The condition "compatible" must be true.

            Assignee:
            gregory.noma@mongodb.com Gregory Noma
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: