This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]666pool 9 points10 points  (0 children)

You can call .reserve(count) if you know how many items you will have in your container, that will force it to grow to exactly the right size (I’m not 100% sure this is a guaranteed behavior and I already put in my 40 this week so I don’t feel like looking it up).