Codechange: Rename function to match what it does and reduce code indenting.

This commit is contained in:
Peter Nelson 2019-01-27 12:35:14 +00:00 committed by Niels Martin Hansen
parent fe37b40385
commit 310fa1af88
1 changed files with 6 additions and 7 deletions

View File

@ -122,14 +122,13 @@ private:
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++) {
if ((*g)->parent == parent) {
*this->groups.Append() = *g;
*this->indents.Append() = indent;
AddParents(source, (*g)->index, indent + 1);
}
if ((*g)->parent != parent) continue;
*this->groups.Append() = *g;
*this->indents.Append() = indent;
AddChildren(source, (*g)->index, indent + 1);
}
}
@ -180,7 +179,7 @@ private:
list.ForceResort();
list.Sort(&GroupNameSorter);
AddParents(&list, INVALID_GROUP, 0);
AddChildren(&list, INVALID_GROUP, 0);
this->groups.Compact();
this->groups.RebuildDone();