Coverity analysis defect 72740: Redundant test

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Replication
    • Replication
    • Fully Compatible
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Test always evaluates the same

      Defect 72740 (STATIC_C)
      Checker DEADCODE (subcategory redundant_test)
      File: /src/mongo/db/repl/data_replicator.cpp
      Function mongo::repl::OplogFetcher::_delegateCallback(const mongo::StatusWith<mongo::repl::Fetcher::BatchData> &, mongo::repl::Fetcher::NextAction *)
      /src/mongo/db/repl/data_replicator.cpp, line: 231
      Condition "hasDoc", taking true branch. Now the value of "hasDoc" is equal to 1.

                      if (checkStartTS &&
      

      /src/mongo/db/repl/data_replicator.cpp, line: 232
      At condition "hasDoc", the value of "hasDoc" must be equal to 1.

                              (!hasDoc || (hasDoc && (*firstDoc)["ts"].timestamp() != _startTS))) {
      

      /src/mongo/db/repl/data_replicator.cpp, line: 231
      The condition "hasDoc" must be true.

                      if (checkStartTS &&
      

            Assignee:
            [DO NOT USE] Backlog - Replication Team
            Reporter:
            Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: