1
0
Fork 0
forked from forgejo/forgejo

Refactor for issues loadattributes of a repository (#971)

* refactor for issues loadattributes of a repository

* refactors
This commit is contained in:
Lunny Xiao 2017-02-22 22:03:59 +08:00 committed by GitHub
parent 29c6f32a3b
commit 1f7837d6d6
3 changed files with 343 additions and 64 deletions

21
models/helper.go Normal file
View file

@ -0,0 +1,21 @@
// Copyright 2017 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package models
func keysInt64(m map[int64]struct{}) []int64 {
var keys = make([]int64, 0, len(m))
for k, _ := range m {
keys = append(keys, k)
}
return keys
}
func valuesRepository(m map[int64]*Repository) []*Repository {
var values = make([]*Repository, 0, len(m))
for _, v := range m {
values = append(values, v)
}
return values
}