[SERVER-43257] Don't use sizeof to get size of valarray in GlobalLockServerStatusSection Created: 10/Sep/19  Updated: 29/Oct/23  Resolved: 11/Sep/19

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

Type: Bug Priority: Major - P3
Reporter: Louis Williams Assignee: Louis Williams
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2019-09-23
Participants:
Linked BF Score: 0

 Description   

This code incorrectly uses sizeof instead of size() to determine the number of elements in the valarray. sizeof returns the size of the type, not the number of elements.

This does not, and has not caused any bugs, but should be fixed for clarity and correctness.



 Comments   
Comment by Githook User [ 11/Sep/19 ]

Author:

{'username': 'louiswilliams', 'email': 'louis.williams@mongodb.com', 'name': 'Louis Williams'}

Message: SERVER-43257 Don't use sizeof to get size of valarray in GlobalLockServerStatusSection
Branch: master
https://github.com/mongodb/mongo/commit/3a508dcd9755cc5012288068ce88afb9117ac8b8

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