-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make pushing back to vectors more efficient #755
Conversation
0cd17b7
to
caad698
Compare
Hi @AtariDreams, thank you for the contributions. How did you determine what to refactor? Are you using a tool we could potentially use for our tests? |
clang-tidy checks for modernize-use-emplace. |
@BillyONeal fixed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other occurrences aren't fixed
525ede1
to
106f267
Compare
@BillyONeal Done! |
a320310
to
978986d
Compare
Any update on this? |
In these places, emplace_back seems to be more efficient than push_back, and the better choice.
It saves a lot of work reserving and working with references instead of copying directly
Co-authored-by: Billy O'Neal <[email protected]>
Thanks :) |
In these places, emplace_back seems to be more efficient than push_back, and the better choice.
We can also improve performance further by reserving the size we know the vector will be so we do not have to waste time resizing.