addListDetails was not optimized to build unique list of list owners

solves one of multiple problems related to #1188
This commit is contained in:
k2s 2022-06-19 19:00:12 +00:00
parent 92a87cfe4f
commit d8b23ceb9f
1 changed files with 5 additions and 1 deletions

View File

@ -445,8 +445,12 @@ func addListDetails(s *xorm.Session, lists []*List, a web.Auth) (err error) {
}
var ownerIDs []int64
keys := make(map[int64]bool)
for _, l := range lists {
ownerIDs = append(ownerIDs, l.OwnerID)
if _, value := keys[l.OwnerID]; !value {
keys[l.OwnerID] = true
ownerIDs = append(ownerIDs, l.OwnerID)
}
}
// Get all list owners