[SERVER-50232] Coverity analysis defect 114371: Redundant test Created: 10/Aug/20  Updated: 29/Oct/23  Resolved: 13/Jan/21

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Dan Larkin-York
Resolution: Fixed Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2021-01-25
Participants:

 Description   

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/storage/flow_control.cpp:443: DEADCODE 114371 At condition "currApplied == -1L", the value of "currApplied" must be equal to -1.
/src/mongo/db/storage/flow_control.cpp:435: DEADCODE 114371 Assigning: "currApplied" = "-1L".
/src/mongo/db/storage/flow_control.cpp:443: DEADCODE 114371 The condition "currApplied == -1L" must be true.



 Comments   
Comment by Githook User [ 13/Jan/21 ]

Author:

{'name': 'Dan Larkin-York', 'email': 'dan.larkin-york@mongodb.com', 'username': 'dhly-etc'}

Message: SERVER-50232 Remove redundant condition from FlowControl::_approximateOpsBetween
Branch: master
https://github.com/mongodb/mongo/commit/60b4db79b9171c60e15e92565f81b422063d8a75

Generated at Thu Feb 08 05:22:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.