Skip to content

[Feature Request] Add extend overload (mut other: Self) #7147

Description

@lebkuchen-1

Review Mojo's priorities

What is your request?

For reference: https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.append
The overload would memmove like the var version, but not deallocate other but rather set its len to 0 and preserve the capacity.
Most of the existing infra could be shared in a private method.

What is your motivation for this change?

Reusing old allocations is a common optimzation known in Rust and C++.

Any other details?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Team: Mojo LibrariesRelevant to the Mojo libraries team, which will review and decide on the issue or PR.bug_feature_triagedenhancementNew feature or requestmojoIssues that are related to mojo

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions