[SERVER-51742] Coverity analysis defect 116487: Redundant test Created: 19/Oct/20  Updated: 27/Oct/23  Resolved: 21/Jun/21

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Gregory Noma
Resolution: Gone away Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Sprint: Execution Team 2021-06-28
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/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.


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