Merge pull request #3670 from geniusgogo/master

Optimize project group sort by name
This commit is contained in:
Bernard Xiong 2020-06-10 22:47:42 +08:00 committed by GitHub
commit 90e67a5ecd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -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