Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

Why not use subvector for vector pop? #5

Closed
rtheunissen opened this issue Jul 26, 2020 · 1 comment
Closed

Why not use subvector for vector pop? #5

rtheunissen opened this issue Jul 26, 2020 · 1 comment

Comments

@rtheunissen
Copy link

Is there a reason why vector.Pop can't be implemented as SubVector(0,v.Len()-1)?

@xiaq
Copy link
Owner

xiaq commented Aug 20, 2020

SubVector really just provides a view over the original vector, and is not very efficient. Pop actually creates a new vector.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants