Codechange: inline sorter name definitions and use proper static accessor instead of (implying) this->

This commit is contained in:
Rubidium
2024-04-28 14:56:52 +02:00
committed by rubidium42
parent ef55cc7979
commit ad50c4f298
4 changed files with 61 additions and 75 deletions

View File

@@ -720,7 +720,12 @@ private:
static Listing last_sorting;
/* Constants for sorting towns */
static const StringID sorter_names[];
static inline const StringID sorter_names[] = {
STR_SORT_BY_NAME,
STR_SORT_BY_POPULATION,
STR_SORT_BY_RATING,
INVALID_STRING_ID
};
static const std::initializer_list<GUITownList::SortFunction * const> sorter_funcs;
StringFilter string_filter; ///< Filter for towns
@@ -1045,14 +1050,6 @@ public:
Listing TownDirectoryWindow::last_sorting = {false, 0};
/** Names of the sorting functions. */
const StringID TownDirectoryWindow::sorter_names[] = {
STR_SORT_BY_NAME,
STR_SORT_BY_POPULATION,
STR_SORT_BY_RATING,
INVALID_STRING_ID
};
/** Available town directory sorting functions. */
const std::initializer_list<GUITownList::SortFunction * const> TownDirectoryWindow::sorter_funcs = {
&TownNameSorter,