Simplify loops to copy (#19569)

- Simplify two loops into `copy` statements.
This commit is contained in:
Gusted 2022-04-30 23:53:56 +00:00 committed by GitHub
parent 1597e2da3e
commit c0a6309a5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View file

@ -76,9 +76,7 @@ func GetLanguages(ctx *context.APIContext) {
}
resp := make(languageResponse, len(langs))
for i, v := range langs {
resp[i] = v
}
copy(resp, langs)
ctx.JSON(http.StatusOK, resp)
}