mirror of
https://github.com/gogs/gogs.git
synced 2026-01-26 09:09:23 +01:00
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
16 lines
288 B
Go
16 lines
288 B
Go
package convert
|
|
|
|
import (
|
|
"gogs.io/gogs/internal/conf"
|
|
)
|
|
|
|
// ToCorrectPageSize makes sure page size is in allowed range.
|
|
func ToCorrectPageSize(size int) int {
|
|
if size <= 0 {
|
|
size = 10
|
|
} else if size > conf.API.MaxResponseItems {
|
|
size = conf.API.MaxResponseItems
|
|
}
|
|
return size
|
|
}
|