summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorOleg Kovalov <iamolegkovalov@gmail.com>2018-10-20 23:25:14 +0200
committertechknowlogick <hello@techknowlogick.com>2018-10-20 17:25:14 -0400
commit5a4648cdd697be92d33be55cd85069365cce2588 (patch)
tree0d246271e482d8d8ffb9f357861c0db5d698064f /routers
parent583b1b84293635633199123ff759849fbd09f7f2 (diff)
downloadgitea-5a4648cdd697be92d33be55cd85069365cce2588.tar.gz
gitea-5a4648cdd697be92d33be55cd85069365cce2588.zip
Remove check for negative length (#5120)
Diffstat (limited to 'routers')
-rw-r--r--routers/api/v1/api.go2
-rw-r--r--routers/user/home.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go
index 23a85759c2..3a539f6ce7 100644
--- a/routers/api/v1/api.go
+++ b/routers/api/v1/api.go
@@ -80,7 +80,7 @@ import (
func sudo() macaron.Handler {
return func(ctx *context.APIContext) {
sudo := ctx.Query("sudo")
- if len(sudo) <= 0 {
+ if len(sudo) == 0 {
sudo = ctx.Req.Header.Get("Sudo")
}
diff --git a/routers/user/home.go b/routers/user/home.go
index 0c84b2498e..cbab5c8350 100644
--- a/routers/user/home.go
+++ b/routers/user/home.go
@@ -213,7 +213,7 @@ func Issues(ctx *context.Context) {
return
}
}
- if len(userRepoIDs) <= 0 {
+ if len(userRepoIDs) == 0 {
userRepoIDs = []int64{-1}
}