Codechange: Use std::initializer_list for NWidgetPart data. (#14749)

Avoids using C/C++ arrays.
This commit is contained in:
Peter Nelson
2025-11-01 22:33:00 +00:00
committed by dP
parent 49dd74ea89
commit c2d92433c6
62 changed files with 160 additions and 158 deletions

View File

@@ -742,7 +742,7 @@ void PickerWindow::EnsureSelectedTypeIsVisible()
/** Create nested widgets for the class picker widgets. */
std::unique_ptr<NWidgetBase> MakePickerClassWidgets()
{
static constexpr NWidgetPart picker_class_widgets[] = {
static constexpr std::initializer_list<NWidgetPart> picker_class_widgets = {
NWidget(NWID_SELECTION, INVALID_COLOUR, WID_PW_CLASS_SEL),
NWidget(NWID_VERTICAL),
NWidget(WWT_PANEL, COLOUR_DARK_GREEN),
@@ -765,7 +765,7 @@ std::unique_ptr<NWidgetBase> MakePickerClassWidgets()
/** Create nested widgets for the type picker widgets. */
std::unique_ptr<NWidgetBase> MakePickerTypeWidgets()
{
static constexpr NWidgetPart picker_type_widgets[] = {
static constexpr std::initializer_list<NWidgetPart> picker_type_widgets = {
NWidget(NWID_SELECTION, INVALID_COLOUR, WID_PW_TYPE_SEL),
NWidget(NWID_VERTICAL),
NWidget(NWID_HORIZONTAL),