mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-10-24 17:25:19 +08:00
Simplify loops to copy (#19569)
- Simplify two loops into `copy` statements.
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user