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

View File

@ -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();