dkforest

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

commit 6c4a62cbe31f9b072891aa3660643bd0f7eda96b
parent fabd2992d17083f44ad7380f226ad88e51f32b4f
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Mon, 25 Dec 2023 12:18:02 -0500

cleanup

Diffstat:
Mpkg/web/handlers/poker/poker.go | 6++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go @@ -1521,16 +1521,14 @@ func processPot(winners []gameResult, mainPot, pokerTableMinBet database.PokerCh mainPot -= rake } + isOnlyPlayerAlive := len(winners) == 1 && len(winners[0].players) == 1 for groupIdx, group := range winners { if mainPot == 0 { break } groupPlayers := group.players groupPlayersLen := len(groupPlayers) - handStr := poker.RankString(group.handScore) - if len(winners) == 1 && len(winners[0].players) == 1 { - handStr = "Only player alive" - } + handStr := utils.Ternary(isOnlyPlayerAlive, "Only player alive", poker.RankString(group.handScore)) // Multiple winners, split pot calcExpectedSplit := func(mainPot database.PokerChip, allInCount int) database.PokerChip { return mainPot / utils.MaxInt(database.PokerChip(groupPlayersLen-allInCount), 1)