Skip to content

Conversation

@googs1025
Copy link
Contributor

No description provided.

@googs1025
Copy link
Contributor Author

@googs1025 googs1025 force-pushed the add/counter branch 2 times, most recently from 100bb9f to b49b40b Compare December 8, 2025 11:44
Copy link
Collaborator

@mayabar mayabar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments regarding buckets limits

@googs1025 googs1025 force-pushed the add/counter branch 2 times, most recently from 786cd5d to 4ee6b72 Compare December 9, 2025 03:48
Copy link
Collaborator

@mayabar mayabar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some additional comments

nBuckets := len(buckets)
nCounts := len(counts)

for i := 0; i <= nBuckets; i++ {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually the counts array will be shorter than the buckets array, seems better to iterate till counts' length.

Comment on lines +812 to +814
if i < nCounts {
count = counts[i]
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in else of this if we can start this loop since got the end of the counts array
consider
if i>= nCounts {
break
}
.. use counts[i]

Comment on lines 254 to +255
// Each value will be passed to Observe() once at start-up.
// exactly once during initialization. Additionally:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix the sentence

switch {
case i == 0:
// First bucket: [0, buckets[0]]
lower = 0.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lower can be initialized before the loop + processing of the last bucket could be done after the loop - in this case no need for switch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants