-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
MenuManager: modernize for loops #14033
base: main
Are you sure you want to change the base?
MenuManager: modernize for loops #14033
Conversation
Can you check your const-correctness here? In at least a couple cases you've lost the iterator const-ness, and a quick glance through the loops makes it look like more of them could be const as well. We should silence those linter errors either by ensuring that the implicit sharing doesn't make copies, or if that's not a problem, by telling the linter to not display that error. |
There are 2 for loops that were using
However its the iterator that is const, not the action. So you cannot change to :
Because then the return type is not correct anymore. Now it needs to be I do not understand the Lint warnings. However I only changed the syntax to newer type of for loop. So I do not see how it could create actual issues. |
The linter warnings are not about the iterator variable but about the container where unnecessarily a deep copy could be created: To fix this warning the line |
a689ec6
to
ef01f88
Compare
I have changed to : I think this syntax is preventing the deep copy issue and looks easier on the eye than the Can you please let me know if this is ok or if it is better to use |
@wwmayer ? |
Using the reference seems to work. |
MenuManager: modernize for loops