Skip to content

Why so many change types for mutable vec? #70

Answered by Pauan
andrewbaxter asked this question in Q&A
Discussion options

You must be logged in to vote

That would be less efficient, because Vec requires a heap allocation. The only time a heap allocation is necessary with VecDiff is with the Replace variant, which completely replaces all the old values with new values.

VecDiff is an internal implementation detail, so the primary goal is correctness, functionality, and performance. Simplicity is a nice bonus, but it is less important than those other goals.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@andrewbaxter
Comment options

@Pauan
Comment options

Answer selected by andrewbaxter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants