-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BAAS-11692: add mem usage for setObject and func objects #121
Conversation
builtin_set.go
Outdated
|
||
// We can use samplesVisited instead of an index since we iterate using | ||
// iterNext | ||
for item := so.m.iterFirst; item != nil && samplesVisited < uint64(totalItems); item = item.iterNext { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[q] looks like totalItems is the size of the map but we only increment sampleVisited
when its divisible by the sample size which means this case should never be true samplesVisited < uint64(totalItems)
(unless you are accounting for size of 1?). Can we remove that check samplesVisited < uint64(totalItems)
:
for item := so.m.iterFirst; item != nil; item = item.iterNext {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're right, even with a step of 1 we would have a nil item and get out I believe so this is not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.