Codechange: Use std::map to provide indexed widget access.
This removes the need to determine the biggest widget index and replaces C-style memory handling.
This commit is contained in:

committed by
Peter Nelson

parent
a12f426d69
commit
b86182ab84
@@ -1942,12 +1942,12 @@ static const NWidgetPart _nested_smallmap_bar[] = {
|
||||
EndContainer(),
|
||||
};
|
||||
|
||||
static NWidgetBase *SmallMapDisplay(int *biggest_index)
|
||||
static NWidgetBase *SmallMapDisplay()
|
||||
{
|
||||
NWidgetContainer *map_display = new NWidgetSmallmapDisplay;
|
||||
|
||||
MakeNWidgets(std::begin(_nested_smallmap_display), std::end(_nested_smallmap_display), biggest_index, map_display);
|
||||
MakeNWidgets(std::begin(_nested_smallmap_bar), std::end(_nested_smallmap_bar), biggest_index, map_display);
|
||||
MakeNWidgets(std::begin(_nested_smallmap_display), std::end(_nested_smallmap_display), map_display);
|
||||
MakeNWidgets(std::begin(_nested_smallmap_bar), std::end(_nested_smallmap_bar), map_display);
|
||||
return map_display;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user