File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -32,9 +32,8 @@ func GetLogDescriptions() map[string]*LogDescription {
32
32
descs := make (map [string ]* LogDescription , len (logDescriptions ))
33
33
for k , v := range logDescriptions {
34
34
subLogDescriptions := make ([]SubLogDescription , len (v .SubLogDescriptions ))
35
- for i , s := range v .SubLogDescriptions {
36
- subLogDescriptions [i ] = s
37
- }
35
+ copy (subLogDescriptions , v .SubLogDescriptions )
36
+
38
37
descs [k ] = & LogDescription {
39
38
Name : v .Name ,
40
39
SubLogDescriptions : subLogDescriptions ,
Original file line number Diff line number Diff line change @@ -76,9 +76,7 @@ func GetLanguages(ctx *context.APIContext) {
76
76
}
77
77
78
78
resp := make (languageResponse , len (langs ))
79
- for i , v := range langs {
80
- resp [i ] = v
81
- }
79
+ copy (resp , langs )
82
80
83
81
ctx .JSON (http .StatusOK , resp )
84
82
}
You can’t perform that action at this time.
0 commit comments