reuse some slices
This commit is contained in:
@@ -63,8 +63,7 @@ func (p *player) nudge() {
|
||||
}
|
||||
|
||||
func (p *player) scan(players map[*player]bool) {
|
||||
// TODO: perhaps keep the same one around?
|
||||
p.Robot.Scanners = make([]bot.Scanner, 0)
|
||||
p.Robot.Scanners = p.Robot.Scanners[:0]
|
||||
for player, _ := range players {
|
||||
if player.Robot.Id == p.Robot.Id || player.Robot.Health <= 0 {
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user