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

Coverity analysis defect 73688: Redundant test

    XMLWordPrintableJSON

Details

    • Fully Compatible
    • ALL
    • QuInt A (10/12/15)

    Description

      Test always evaluates the same

      Defect 73688 (STATIC_C)
      Checker DEADCODE (subcategory redundant_test)
      File: /src/mongo/db/commands/geo_near_cmd.cpp
      Function mongo::Geo2dFindNearCmd::run(mongo::OperationContext *, const std::basic_string<char, std::char_traits<char>, std::allocator<char>>&, mongo::BSONObj &, int, std::basic_string<char, std::char_traits<char>, std::allocator<char>>&, mongo::BSONObjBuilder &)
      /src/mongo/db/commands/geo_near_cmd.cpp, line: 104
      Condition "collection", taking true branch. Now the value of "collection" is not "NULL".

                  if (!collection) {
      

      /src/mongo/db/commands/geo_near_cmd.cpp, line: 284
      At condition "collection", the value of "collection" cannot be "NULL".

                  if (collection) {
      

      /src/mongo/db/commands/geo_near_cmd.cpp, line: 284
      The condition "collection" must be true.

                  if (collection) {
      

      Attachments

        Activity

          People

            james.wahlin@mongodb.com James Wahlin
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: