aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/language.go
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 /routers/api/v1/repo/language.go
parent1597e2da3e72b9a846f7b17bf38c1d192f43c182 (diff)
downloadgitea-c0a6309a5f62a4947788baa29df9a03e80607f51.tar.gz
gitea-c0a6309a5f62a4947788baa29df9a03e80607f51.zip
Simplify loops to copy (#19569)
- Simplify two loops into `copy` statements.
Diffstat (limited to 'routers/api/v1/repo/language.go')
-rw-r--r--routers/api/v1/repo/language.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/routers/api/v1/repo/language.go b/routers/api/v1/repo/language.go
index 427a8fd6b5..f47b0a0e78 100644
--- a/routers/api/v1/repo/language.go
+++ b/routers/api/v1/repo/language.go
@@ -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)
}