Skip to content

Ensure _Idx is only worked on if it has to be.#3658

Merged
StephanTLavavej merged 1 commit intomicrosoft:mainfrom
SiliconA-Z:idx
Apr 28, 2023
Merged

Ensure _Idx is only worked on if it has to be.#3658
StephanTLavavej merged 1 commit intomicrosoft:mainfrom
SiliconA-Z:idx

Conversation

@SiliconA-Z
Copy link
Contributor

I don't know if whatever compile is supposed to compile this will notice, but this is the only place where this structure appears, so it seems best that the incrementation be done within the loop.

I don't know if whatever compile is supposed to compile this will notice, but this is the only place where this structure appears, so it seems best that the incrementation be done within the loop.
@SiliconA-Z SiliconA-Z requested a review from a team as a code owner April 17, 2023 20:36
@StephanTLavavej StephanTLavavej added the enhancement Something can be improved label Apr 17, 2023
Copy link
Contributor

@strega-nil-ms strega-nil-ms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small change, but appreciated.

@StephanTLavavej
Copy link
Member

This is correct (no effective behavioral change) because _Idx isn't observed after the loop, so it doesn't matter that we're changing from wrapping around the size_t to leaving it at 0.

@StephanTLavavej StephanTLavavej self-assigned this Apr 27, 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 3e75f32 into microsoft:main Apr 28, 2023
@StephanTLavavej
Copy link
Member

Thanks for cleaning up this code! 🧹 🐱 🎉

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.

4 participants

Comments