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

(concurrentbatchprocessor): Allow re-use of the pending slice #258

Merged
merged 3 commits into from
Oct 1, 2024

Conversation

jmacd
Copy link
Contributor

@jmacd jmacd commented Sep 30, 2024

This avoids a pitfall in which we repeatedly re-slice b.pending to b.pending[1:], which causes the slice to be re-allocated instead of re-used. To re-use the slice, shift its contents by one, zero the final element, and shorten it by one.

@jmacd jmacd merged commit 7cceec5 into open-telemetry:main Oct 1, 2024
2 checks passed
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