summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorGusted <williamzijl7@hotmail.com>2022-04-30 23:53:56 +0000
committerGitHub <noreply@github.com>2022-05-01 01:53:56 +0200
commitc0a6309a5f62a4947788baa29df9a03e80607f51 (patch)
treeb0d011a4273e6d68f558ac394ecb519624df0a82 /modules
parent1597e2da3e72b9a846f7b17bf38c1d192f43c182 (diff)
downloadgitea-c0a6309a5f62a4947788baa29df9a03e80607f51.tar.gz
gitea-c0a6309a5f62a4947788baa29df9a03e80607f51.zip
Simplify loops to copy (#19569)
- Simplify two loops into `copy` statements.
Diffstat (limited to 'modules')
-rw-r--r--modules/setting/log.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/setting/log.go b/modules/setting/log.go
index e666e2a027..008a419b09 100644
--- a/modules/setting/log.go
+++ b/modules/setting/log.go
@@ -32,9 +32,8 @@ func GetLogDescriptions() map[string]*LogDescription {
descs := make(map[string]*LogDescription, len(logDescriptions))
for k, v := range logDescriptions {
subLogDescriptions := make([]SubLogDescription, len(v.SubLogDescriptions))
- for i, s := range v.SubLogDescriptions {
- subLogDescriptions[i] = s
- }
+ copy(subLogDescriptions, v.SubLogDescriptions)
+
descs[k] = &LogDescription{
Name: v.Name,
SubLogDescriptions: subLogDescriptions,