summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/group_gui.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/group_gui.cpp b/src/group_gui.cpp
index 811b46af8..a88492084 100644
--- a/src/group_gui.cpp
+++ b/src/group_gui.cpp
@@ -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();