-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Rename ForEach with Range to be consistent with sync.Map #2931
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2931 +/- ##
==========================================
+ Coverage 91.66% 91.68% +0.01%
==========================================
Files 312 312
Lines 15317 15338 +21
==========================================
+ Hits 14041 14062 +21
Misses 870 870
Partials 406 406
Continue to review full report at Codecov.
|
consumer/pdata/common.go
Outdated
// ... | ||
// }) | ||
func (am AttributeMap) ForEach(f func(k string, v AttributeValue)) { | ||
func (am AttributeMap) Range(f func(k string, v AttributeValue)) { |
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.
If we aim for consistency also make f
return bool to stop iteration like sync.Map.Range does. That's useful for search operations.
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.
@tigrannajaryan sure, changed :)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
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
Updates #2488
Signed-off-by: Bogdan Drutu bogdandrutu@gmail.com