[SERVER-50811] Coverity analysis defect 114464: Redundant test Created: 09/Sep/20  Updated: 29/Oct/23  Resolved: 09/Oct/20

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

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Lamont Nelson
Resolution: Fixed Votes: 0
Labels: coverity, sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
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/client/sdam/server_selector.cpp:259: DEADCODE 114464 At condition "result", the value of "result" must be equal to 1.
/src/mongo/client/sdam/server_selector.cpp:255: DEADCODE 114464 Assigning: "result" = "true".
/src/mongo/client/sdam/server_selector.cpp:258: DEADCODE 114464 The condition "result" must be true.



 Comments   
Comment by Githook User [ 09/Oct/20 ]

Author:

{'name': 'LaMont Nelson', 'email': 'lamont.nelson@mongodb.com', 'username': 'lamontnelson'}

Message: SERVER-50811: remove redundant boolean expression
Branch: master
https://github.com/mongodb/mongo/commit/4fe8abd3c83db520c57b418f57f5ef8f08b18d10

Comment by Lamont Nelson [ 09/Oct/20 ]

code review: https://mongodbcr.appspot.com/707800001/

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