Skip to content

Move ArrayListSentineled to std lib orphanage#7531

Merged
Vexu merged 2 commits intoziglang:masterfrom
Vexu:orphanage
Dec 24, 2020
Merged

Move ArrayListSentineled to std lib orphanage#7531
Vexu merged 2 commits intoziglang:masterfrom
Vexu:orphanage

Conversation

@Vexu
Copy link
Copy Markdown
Member

@Vexu Vexu commented Dec 23, 2020

Keeping the list sentinel terminated makes use of the type more difficult and expensive compared to a regular ArrayList. Combined with the fact that most usages of it that I could find either completely ignored the sentinel or could easily be replaced by the toOwndedSliceSentinel function I added and that a lot of its functionality has bitrotten makes it hard to justify keeping it in the standard library.

Closes #6968
Closes #6967

@Vexu Vexu added standard library This issue involves writing Zig code for the standard library. proposal This issue suggests language modifications. If it also has the "accepted" label then it is planned. labels Dec 23, 2020
Comment thread lib/std/child_process.zig Outdated
Comment thread lib/std/net.zig
Copy link
Copy Markdown
Member

@kubkon kubkon left a comment

Choose a reason for hiding this comment

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

In general, I find the new transformer ArrayList.toOwnedSliceSentinel much cleaner than an entirely separate container type ArrayListSentineled. Additionally, now it should be easier to maintain the said container as well. So 👍 from me.

Copy link
Copy Markdown
Contributor

@daurnimator daurnimator left a comment

Choose a reason for hiding this comment

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

Oh how far std.Buffer has fallen 👍

#4665, #4405

@Vexu Vexu merged commit 83646df into ziglang:master Dec 24, 2020
@Vexu Vexu deleted the orphanage branch December 24, 2020 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

proposal This issue suggests language modifications. If it also has the "accepted" label then it is planned. standard library This issue involves writing Zig code for the standard library.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

std.ArrayListSentineled integer overflow error.

4 participants