Skip to content

Commit 2857cba

Browse files
committed
Bugfix: Only publish yellow card times >= 0
1 parent e6dde77 commit 2857cba

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

internal/app/publish/datamapper.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,11 @@ func commandByTeam(team state.Team, blueCommand state.Referee_Command, yellowCom
5757
return -1
5858
}
5959

60-
func mapYellowCardTimes(cards []*state.YellowCard) []uint32 {
61-
times := make([]uint32, len(cards))
62-
for i, c := range cards {
60+
func mapYellowCardTimes(cards []*state.YellowCard) (times []uint32) {
61+
for _, c := range cards {
6362
duration, _ := ptypes.Duration(c.TimeRemaining)
6463
if duration > 0 {
65-
times[i] = mapTime(duration)
64+
times = append(times, mapTime(duration))
6665
}
6766
}
6867
return times

0 commit comments

Comments
 (0)