Cleanup: Replace FOR_ALL_SORTED_RAILTYPES macro with range iterator.
This commit is contained in:
@@ -2191,17 +2191,16 @@ DropDownList GetRailTypeDropDownList(bool for_replacement, bool all_option)
|
||||
}
|
||||
|
||||
Dimension d = { 0, 0 };
|
||||
RailType rt;
|
||||
/* Get largest icon size, to ensure text is aligned on each menu item. */
|
||||
if (!for_replacement) {
|
||||
FOR_ALL_SORTED_RAILTYPES(rt) {
|
||||
for (const auto &rt : _sorted_railtypes) {
|
||||
if (!HasBit(used_railtypes, rt)) continue;
|
||||
const RailtypeInfo *rti = GetRailTypeInfo(rt);
|
||||
d = maxdim(d, GetSpriteSize(rti->gui_sprites.build_x_rail));
|
||||
}
|
||||
}
|
||||
|
||||
FOR_ALL_SORTED_RAILTYPES(rt) {
|
||||
for (const auto &rt : _sorted_railtypes) {
|
||||
/* If it's not used ever, don't show it to the user. */
|
||||
if (!HasBit(used_railtypes, rt)) continue;
|
||||
|
||||
|
Reference in New Issue
Block a user