reuse some slices

This commit is contained in:
sm
2013-09-07 19:13:12 -07:00
parent bf853880ca
commit b7087adb78
2 changed files with 5 additions and 5 deletions
+1 -2
View File
@@ -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