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

std: implement BoundedArray.addManyAsSlice #19962

Merged
merged 1 commit into from
May 21, 2024

Conversation

sjb3d
Copy link
Contributor

@sjb3d sjb3d commented May 13, 2024

This PR implements BoundedArray.addManyAsSlice, for parity with ArrayList.addManyAsSlice.

I noticed this API was missing when switching a buffer from ArrayList to BoundedArray since a small fixed size buffer was enough for my use case, and avoided an allocation. I think it would be useful for these two containers to share the same methods where possible, so that users of the standard library can make this kind of switch easily.

The PR also has a doc comment fix for BoundedArray.addManyAsArray, since it returns a pointer to an array, not a slice.

Closes #19967.

@sjb3d sjb3d changed the title Implement addManyAsSlice for BoundedArray std: implement BoundedArray.addManyAsSlice May 17, 2024
@Vexu Vexu merged commit 33d7815 into ziglang:master May 21, 2024
10 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.

std: BoundedArray is missing addManyAsSlice method
2 participants