-
Notifications
You must be signed in to change notification settings - Fork 7
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
Remove loop* and loopv* macros from menus.cpp #175
base: master
Are you sure you want to change the base?
Conversation
You're using a different code style, '{' on same line and space after |
@robalni Indeed, I do. Because:
saves space and is just as easy to read as
I only like to do that when there's only one line inside the curly brackets (I hope I didn't violate that rule in here) |
I prefer to have everything the same, otherwise it will look like a mess after a while. |
Hum, ok, can't hurt. :) will change it |
alright, now it should be good. |
@@ -850,7 +863,10 @@ static struct applymenu : menu | |||
g.start(menu_start, NULL, true); | |||
g.text("the following settings have changed:"); | |||
g.pushfont("little"); | |||
loopv(needsapply) g.text(needsapply[i].desc, 0xFFFFFF, "point"); | |||
for (int i = 0; i < needsapply.length(); i++) |
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.
I would suggest not to just stubbornly replace all occurrences of the macro, but just go for the more modern iterator-based loops where applicable. How about
for (int i = 0; i < needsapply.length(); i++) | |
for (const auto& i : needsapply) |
If you can not use this approach, please don't use the deprecated length()
but the STL-compatible size()
.
Applies to pretty much all loops you modified.
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.
Yeah, I'll do that
Basically just doing a little bit of refactoring by getting rid of all
loop
macros insrc/engine/menus.cpp