mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-01-31 19:33:34 +00:00
Codechange: Rename function to match what it does and reduce code indenting.
This commit is contained in:
parent
fe37b40385
commit
310fa1af88
@ -122,14 +122,13 @@ private:
|
|||||||
|
|
||||||
Dimension column_size[VGC_END]; ///< Size of the columns in the group list.
|
Dimension column_size[VGC_END]; ///< Size of the columns in the group list.
|
||||||
|
|
||||||
void AddParents(GUIGroupList *source, GroupID parent, int indent)
|
void AddChildren(GUIGroupList *source, GroupID parent, int indent)
|
||||||
{
|
{
|
||||||
for (const Group **g = source->Begin(); g != source->End(); g++) {
|
for (const Group **g = source->Begin(); g != source->End(); g++) {
|
||||||
if ((*g)->parent == parent) {
|
if ((*g)->parent != parent) continue;
|
||||||
*this->groups.Append() = *g;
|
*this->groups.Append() = *g;
|
||||||
*this->indents.Append() = indent;
|
*this->indents.Append() = indent;
|
||||||
AddParents(source, (*g)->index, indent + 1);
|
AddChildren(source, (*g)->index, indent + 1);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,7 +179,7 @@ private:
|
|||||||
list.ForceResort();
|
list.ForceResort();
|
||||||
list.Sort(&GroupNameSorter);
|
list.Sort(&GroupNameSorter);
|
||||||
|
|
||||||
AddParents(&list, INVALID_GROUP, 0);
|
AddChildren(&list, INVALID_GROUP, 0);
|
||||||
|
|
||||||
this->groups.Compact();
|
this->groups.Compact();
|
||||||
this->groups.RebuildDone();
|
this->groups.RebuildDone();
|
||||||
|
Loading…
Reference in New Issue
Block a user