Skip to content
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

<system_error>: Optimize internal class _System_error #3635

Merged
merged 1 commit into from
Apr 14, 2023
Merged

<system_error>: Optimize internal class _System_error #3635

merged 1 commit into from
Apr 14, 2023

Conversation

diamante0018
Copy link
Contributor

Hello, from a conversation that occurred on the STL Discord server, I noted that a call to ctor of the internal class _System_error appeared to take some extra unnecessary steps when the error message was empty.
As suggested by Stephan I opened a pull request in an attempt to simplify the code.

The goal of this pull request is to skip entirely the call to the internal function _Makestr since it would have no effect on an empty string. I think my pull request does not have any unintended consequences. This is also my first contribution so please let me know if I messed something up. I have been lurking on the activity on this repo for a while and on the Discord server so I tried my best to follow the code conventions 😄

@diamante0018 diamante0018 requested a review from a team as a code owner April 7, 2023 20:33
@StephanTLavavej StephanTLavavej added the performance Must go faster label Apr 7, 2023
@StephanTLavavej StephanTLavavej changed the title system_error: Optimize internal class _System_error <system_error>: Optimize internal class _System_error Apr 7, 2023
@StephanTLavavej
Copy link
Member

Looks perfect, thank you!

One note - in the future, we recommend avoiding force-pushing branches after creating PRs, because GitHub makes incremental reviewing difficult when this happens.

@diamante0018
Copy link
Contributor Author

diamante0018 commented Apr 7, 2023

Looks perfect, thank you!

One note - in the future, we recommend avoiding force-pushing branches after creating PRs, because GitHub makes incremental reviewing difficult when this happens.

Thanks for the tips here and on Discord

@StephanTLavavej StephanTLavavej self-assigned this Apr 12, 2023
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit c2bb631 into microsoft:main Apr 14, 2023
@StephanTLavavej
Copy link
Member

Thanks for improving the performance of these constructors, and congratulations on your first microsoft/STL commit! 🚀 🎉 😻

This will ship in VS 2022 17.7 Preview 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Must go faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants