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:
@@ -200,7 +200,7 @@ static WindowDesc _performance_league_desc(
|
||||
WDP_AUTO, "performance_league", 0, 0,
|
||||
WC_COMPANY_LEAGUE, WC_NONE,
|
||||
0,
|
||||
_nested_performance_league_widgets, lengthof(_nested_performance_league_widgets)
|
||||
std::begin(_nested_performance_league_widgets), std::end(_nested_performance_league_widgets)
|
||||
);
|
||||
|
||||
void ShowPerformanceLeagueTable()
|
||||
@@ -432,7 +432,7 @@ static WindowDesc _script_league_desc(
|
||||
WDP_AUTO, "script_league", 0, 0,
|
||||
WC_COMPANY_LEAGUE, WC_NONE,
|
||||
0,
|
||||
_nested_script_league_widgets, lengthof(_nested_script_league_widgets)
|
||||
std::begin(_nested_script_league_widgets), std::end(_nested_script_league_widgets)
|
||||
);
|
||||
|
||||
void ShowScriptLeagueTable(LeagueTableID table)
|
||||
|
Reference in New Issue
Block a user