dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit 57e1cdd41048cc347782930010b200c6eae71bfe
parent 0963111caa684efd87c0cecca1b37484981050c0
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Fri, 16 Jun 2023 21:31:01 -0700

simplify code

Diffstat:
Mpkg/web/handlers/chess.go | 5+----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/pkg/web/handlers/chess.go b/pkg/web/handlers/chess.go @@ -131,10 +131,7 @@ func ChessGameAnalyseHandler(c echo.Context) error { if game.Outcome() == chess.NoOutcome { return c.String(http.StatusOK, "no outcome") } - t := utils.DoParseInt64(c.QueryParam("t")) - if t == 0 { - t = 15 - } + t := utils.DoParseInt64OrDefault(c.QueryParam("t"), 15) t = utils.Clamp(t, 1, 60) res, err := interceptors.AnalyseGame(game.String(), t) if err != nil {