[SERVER-50829] Coverity analysis defect 114409: Redundant test Created: 09/Sep/20  Updated: 06/Dec/22  Resolved: 15/Sep/20

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

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Backlog - Query Team (Inactive)
Resolution: Won't Do Votes: 0
Labels: coverity, coverity-pm-1854-tracking, qexec-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-49363 Triage Coverity Issues for Query code... Closed
Assigned Teams:
Query
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/db/pipeline/expression.cpp:884: DEADCODE 114409 At condition "cmp > 0", the value of "cmp" must be at least 1.
/src/mongo/db/pipeline/expression.cpp:884: DEADCODE 114409 At condition "cmp > 0", the value of "cmp" cannot be equal to 0.
/src/mongo/db/pipeline/expression.cpp:882: DEADCODE 114409 Condition "cmp < 0", taking false branch. Now the value of "cmp" is at least 1.
/src/mongo/db/pipeline/expression.cpp:880: DEADCODE 114409 Condition "cmp == 0", taking false branch. Now the value of "cmp" cannot be equal to 0.
/src/mongo/db/pipeline/expression.cpp:884: DEADCODE 114409 The condition "cmp > 0" must be true.


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