Codechange: Use begin/end of nwidget parts of begin/length.
This simplifies processing nwidget parts as, unlike the remaining length, the pointer to the end of the list never changes. This is the same principle as we use(d) for tracking end instead of length for C-style strings. And this removes 160~ instances of the lengthof() macro.
This commit is contained in:
@@ -349,7 +349,7 @@ static WindowDesc _build_docks_toolbar_desc(
|
||||
WDP_ALIGN_TOOLBAR, "toolbar_water", 0, 0,
|
||||
WC_BUILD_TOOLBAR, WC_NONE,
|
||||
WDF_CONSTRUCTION,
|
||||
_nested_build_docks_toolbar_widgets, lengthof(_nested_build_docks_toolbar_widgets),
|
||||
std::begin(_nested_build_docks_toolbar_widgets), std::end(_nested_build_docks_toolbar_widgets),
|
||||
&BuildDocksToolbarWindow::hotkeys
|
||||
);
|
||||
|
||||
@@ -393,7 +393,7 @@ static WindowDesc _build_docks_scen_toolbar_desc(
|
||||
WDP_AUTO, "toolbar_water_scen", 0, 0,
|
||||
WC_SCEN_BUILD_TOOLBAR, WC_NONE,
|
||||
WDF_CONSTRUCTION,
|
||||
_nested_build_docks_scen_toolbar_widgets, lengthof(_nested_build_docks_scen_toolbar_widgets)
|
||||
std::begin(_nested_build_docks_scen_toolbar_widgets), std::end(_nested_build_docks_scen_toolbar_widgets)
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -499,7 +499,7 @@ static WindowDesc _build_dock_station_desc(
|
||||
WDP_AUTO, nullptr, 0, 0,
|
||||
WC_BUILD_STATION, WC_BUILD_TOOLBAR,
|
||||
WDF_CONSTRUCTION,
|
||||
_nested_build_dock_station_widgets, lengthof(_nested_build_dock_station_widgets)
|
||||
std::begin(_nested_build_dock_station_widgets), std::end(_nested_build_dock_station_widgets)
|
||||
);
|
||||
|
||||
static void ShowBuildDockStationPicker(Window *parent)
|
||||
@@ -597,7 +597,7 @@ static WindowDesc _build_docks_depot_desc(
|
||||
WDP_AUTO, nullptr, 0, 0,
|
||||
WC_BUILD_DEPOT, WC_BUILD_TOOLBAR,
|
||||
WDF_CONSTRUCTION,
|
||||
_nested_build_docks_depot_widgets, lengthof(_nested_build_docks_depot_widgets)
|
||||
std::begin(_nested_build_docks_depot_widgets), std::end(_nested_build_docks_depot_widgets)
|
||||
);
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user