From 0c3ad51a7bd00218fed703c5ea77720e2f4bd5e8 Mon Sep 17 00:00:00 2001 From: Branden J Brown Date: Thu, 28 Mar 2024 08:13:28 -0500 Subject: [PATCH] robot: minor refactor with min --- robot.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/robot.go b/robot.go index c192872..7f6dcd6 100644 --- a/robot.go +++ b/robot.go @@ -218,10 +218,7 @@ func (robo *Robot) join(ctx context.Context, send chan<- *tmi.Message) { } burst := 20 for len(ls) > 0 { - l := ls - if len(l) > burst { - l = l[:burst] - } + l := ls[:min(burst, len(ls))] ls = ls[len(l):] msg := tmi.Message{ Command: "JOIN",