From ba32394a00fee9b749ae0a7c690828bb38b028a7 Mon Sep 17 00:00:00 2001 From: xieyangrun Date: Mon, 8 Jun 2020 18:07:04 +0800 Subject: [PATCH] Optimize project group sort by name --- tools/building.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/building.py b/tools/building.py index 65af794434..de49c14a63 100644 --- a/tools/building.py +++ b/tools/building.py @@ -675,8 +675,17 @@ def DefineGroup(name, src, depend, **parameters): MergeGroup(g, group) return objs + def PriorityInsertGroup(groups, group): + length = len(groups) + for i in range(0, length): + if cmp(groups[i]['name'].lower(), group['name'].lower()) > 0: + groups.insert(i, group) + return + groups.append(group) + # add a new group - Projects.append(group) + #Projects.append(group) + PriorityInsertGroup(Projects, group) return objs