-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
src: collapse local var scope in loop #57626
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
src: collapse local var scope in loop #57626
Conversation
|
Review requested:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #57626 +/- ##
==========================================
- Coverage 88.54% 88.52% -0.03%
==========================================
Files 703 703
Lines 208545 208545
Branches 40216 40222 +6
==========================================
- Hits 184652 184607 -45
- Misses 15905 15950 +45
Partials 7988 7988
🚀 New features to boost your workflow:
|
addaleax
left a comment
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.
There's no harm in this, but ideally the commit message would describe the motivation for this change as well, esp. since it is a purely stylistic one
0f15e9d to
426d089
Compare
Thanks, I edited |
|
Thanks for the review. I'm closing this PR because C++ already optimizes local variables, and the new scope is more appropriate. |
This change narrows the scope of local variables to within the loop to improve code clarity and reduce the risk of variable misuse. Although purely stylistic, it helps with maintainability.