Skip to content
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

[pdata] Fix Map.EnsureCapacity bug when the Map is not empty #8040

Conversation

tigrannajaryan
Copy link
Member

EnsureCapacity was incorrectly clearing the Map when increasing the capacity. It will now correctly preserve existing elements.

EnsureCapacity was incorrectly clearing the Map when increasing the capacity.
It will now correctly preserve existing elements.
@tigrannajaryan tigrannajaryan added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Jul 5, 2023
@codecov
Copy link

codecov bot commented Jul 5, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.02 🎉

Comparison is base (9375d95) 90.82% compared to head (aba3d9d) 90.85%.

❗ Current head aba3d9d differs from pull request most recent head f36886f. Consider uploading reports for the commit f36886f to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8040      +/-   ##
==========================================
+ Coverage   90.82%   90.85%   +0.02%     
==========================================
  Files         300      300              
  Lines       15108    15108              
==========================================
+ Hits        13722    13726       +4     
+ Misses       1112     1109       -3     
+ Partials      274      273       -1     
Impacted Files Coverage Δ
pdata/pcommon/map.go 93.95% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@tigrannajaryan tigrannajaryan marked this pull request as ready for review July 5, 2023 22:16
@tigrannajaryan tigrannajaryan requested review from a team and dmitryax July 5, 2023 22:16
Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

Minor typo, otherwise looks good.

pdata/pcommon/map_test.go Outdated Show resolved Hide resolved
Co-authored-by: Alex Boten <alex@boten.ca>
@codeboten codeboten merged commit 89e13a1 into open-telemetry:main Jul 7, 2023
27 checks passed
@github-actions github-actions bot added this to the next release milestone Jul 7, 2023
@tigrannajaryan tigrannajaryan deleted the feature/tigran/fixmapensurecapacity branch July 7, 2023 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants