diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-03-31 17:20:39 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-31 17:20:39 +0800 |
commit | d4f84f1c937e24e71aa5f05c58d440cde741450f (patch) | |
tree | 18571ad08fabe6d1090ea4d2674beab3b1c00a6e /modules/container | |
parent | 43332a483f7838df66e0209eb9c15d4aba3d5874 (diff) | |
download | gitea-d4f84f1c937e24e71aa5f05c58d440cde741450f.tar.gz gitea-d4f84f1c937e24e71aa5f05c58d440cde741450f.zip |
Move reaction to models/issues/ (#19264)
* Move reaction to models/issues/
* Fix test
* move the function
* improve code
* Update models/issues/reaction.go
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'modules/container')
-rw-r--r-- | modules/container/map.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/container/map.go b/modules/container/map.go new file mode 100644 index 0000000000..3519de0951 --- /dev/null +++ b/modules/container/map.go @@ -0,0 +1,14 @@ +// Copyright 2022 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 container + +// KeysInt64 returns keys slice for a map with int64 key +func KeysInt64(m map[int64]struct{}) []int64 { + keys := make([]int64, 0, len(m)) + for k := range m { + keys = append(keys, k) + } + return keys +} |