forked from go-gitea/gitea
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor for issues loadattributes of a repository (go-gitea#971)
* refactor for issues loadattributes of a repository * refactors
- Loading branch information
Showing
3 changed files
with
343 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.