[SERVER-70522] Coverity analysis defect 133979: Parse warning Created: 13/Oct/22  Updated: 29/Oct/23  Resolved: 12/May/23

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

Type: Improvement Priority: Minor - P4
Reporter: Coverity Collector User Assignee: Maddie Zechar
Resolution: Fixed Votes: 0
Labels: coverity, quick-tech-debt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Optimization
Backwards Compatibility: Fully Compatible
Participants:

 Description   

Parse warning

A parse warning may reduce maintainability of the code, or it may indicate a serious error. A parse warning from the Coverity parser may indicate a bug, or poor coding practice
/src/mongo/db/query/ce/array_histogram.cpp:139: PW.USELESS_TYPE_QUALIFIER_ON_RETURN_TYPE 133979 type qualifier on return type is meaningless



 Comments   
Comment by Maddie Zechar [ 12/May/23 ]

This coverity ticket was resolved by the follow-up commit in SERVER-69795 which addressed this linter error. non-class type rvalues are never modifiable and thus the const was redundant. The solution was to change the return type on getArrayCount() and getEmptyArrayCount() from const size_t to size_t.

Generated at Thu Feb 08 06:16:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.