Optimize project group sort by name

This commit is contained in:
xieyangrun 2020-06-08 18:07:04 +08:00
parent ce83371504
commit ba32394a00
1 changed files with 10 additions and 1 deletions

View File

@ -675,8 +675,17 @@ def DefineGroup(name, src, depend, **parameters):
MergeGroup(g, group) MergeGroup(g, group)
return objs 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 # add a new group
Projects.append(group) #Projects.append(group)
PriorityInsertGroup(Projects, group)
return objs return objs