Skip to content

<system_error>: Optimize internal class _System_error - #3635

Merged
Stephan T. Lavavej (StephanTLavavej) merged 1 commit into
microsoft:mainfrom
diamante0018:main
Apr 14, 2023
Merged

<system_error>: Optimize internal class _System_error#3635
Stephan T. Lavavej (StephanTLavavej) merged 1 commit into
microsoft:mainfrom
diamante0018:main

Conversation

@diamante0018

Copy link
Copy Markdown
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
Diamante (diamante0018) requested a review from a team as a code owner April 7, 2023 20:33
@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) changed the title system_error: Optimize internal class _System_error <system_error>: Optimize internal class _System_error Apr 7, 2023
@StephanTLavavej

Copy link
Copy Markdown
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

Diamante (diamante0018) commented Apr 7, 2023

Copy link
Copy Markdown
Contributor Author

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

Comment thread stl/inc/system_error
@StephanTLavavej

Copy link
Copy Markdown
Member

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

@StephanTLavavej
Stephan T. Lavavej (StephanTLavavej) merged commit c2bb631 into microsoft:main Apr 14, 2023
@StephanTLavavej

Copy link
Copy Markdown
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