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 {
3232 descs := make (map [string ]* LogDescription , len (logDescriptions ))
3333 for k , v := range logDescriptions {
3434 subLogDescriptions := make ([]SubLogDescription , len (v .SubLogDescriptions ))
35- for i , s := range v .SubLogDescriptions {
36- subLogDescriptions [i ] = s
37- }
35+ copy (subLogDescriptions , v .SubLogDescriptions )
36+
3837 descs [k ] = & LogDescription {
3938 Name : v .Name ,
4039 SubLogDescriptions : subLogDescriptions ,
Original file line number Diff line number Diff line change @@ -76,9 +76,7 @@ func GetLanguages(ctx *context.APIContext) {
7676 }
7777
7878 resp := make (languageResponse , len (langs ))
79- for i , v := range langs {
80- resp [i ] = v
81- }
79+ copy (resp , langs )
8280
8381 ctx .JSON (http .StatusOK , resp )
8482}
You can’t perform that action at this time.
0 commit comments