aboutsummaryrefslogtreecommitdiffstats
path: root/services/lfs/locks.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/lfs/locks.go')
-rw-r--r--services/lfs/locks.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/services/lfs/locks.go b/services/lfs/locks.go
index 1d464f4a66..264001f0f9 100644
--- a/services/lfs/locks.go
+++ b/services/lfs/locks.go
@@ -74,10 +74,7 @@ func GetListLockHandler(ctx *context.Context) {
}
ctx.Resp.Header().Set("Content-Type", lfs_module.MediaType)
- cursor := ctx.FormInt("cursor")
- if cursor < 0 {
- cursor = 0
- }
+ cursor := max(ctx.FormInt("cursor"), 0)
limit := ctx.FormInt("limit")
if limit > setting.LFS.LocksPagingNum && setting.LFS.LocksPagingNum > 0 {
limit = setting.LFS.LocksPagingNum
@@ -239,10 +236,7 @@ func VerifyLockHandler(ctx *context.Context) {
ctx.Resp.Header().Set("Content-Type", lfs_module.MediaType)
- cursor := ctx.FormInt("cursor")
- if cursor < 0 {
- cursor = 0
- }
+ cursor := max(ctx.FormInt("cursor"), 0)
limit := ctx.FormInt("limit")
if limit > setting.LFS.LocksPagingNum && setting.LFS.LocksPagingNum > 0 {
limit = setting.LFS.LocksPagingNum