Skip to content

Commit 0c3ad51

Browse files
committed
robot: minor refactor with min
1 parent 4dcca40 commit 0c3ad51

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

robot.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,7 @@ func (robo *Robot) join(ctx context.Context, send chan<- *tmi.Message) {
218218
}
219219
burst := 20
220220
for len(ls) > 0 {
221-
l := ls
222-
if len(l) > burst {
223-
l = l[:burst]
224-
}
221+
l := ls[:min(burst, len(ls))]
225222
ls = ls[len(l):]
226223
msg := tmi.Message{
227224
Command: "JOIN",

0 commit comments

Comments
 (0)