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

Cleanups 4: quoted() #2676

Merged
merged 2 commits into from
May 1, 2022

Conversation

StephanTLavavej
Copy link
Member

  • Avoid repeating types in quoted() by using return {m,e,o,w};.
    • The types are verbose, and the constructors are implicit. I considered this slightly more convenient/readable than returning auto.
  • Use char_traits::length() instead of a raw loop in quoted().
    • Please verify my claim that this does not change runtime behavior (we're getting the same answer, number of characters before the null terminator).
    • I think we might have thought that char_traits was unavailable, but it is totally available here, just through an epic-length chain of dependencies. Using char_traits is not only simpler, it has the potential to be faster for char (especially) and wchar_t.

@StephanTLavavej StephanTLavavej added the enhancement Something can be improved label Apr 27, 2022
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner April 27, 2022 20:55
@strega-nil-ms strega-nil-ms self-assigned this Apr 27, 2022
@CaseyCarter CaseyCarter removed their assignment Apr 28, 2022
@StephanTLavavej
Copy link
Member Author

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

@StephanTLavavej StephanTLavavej merged commit 311c59a into microsoft:main May 1, 2022
@StephanTLavavej StephanTLavavej deleted the cleanups-4-quoted branch May 1, 2022 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something can be improved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
  翻译: