simplified some loops

These changes were done by running the following command:

    gofmt -s -w *.go
This commit is contained in:
Stephen McQuay 2013-11-09 21:52:03 -08:00
parent bc2d1cdd52
commit da26e1ca46
2 changed files with 3 additions and 3 deletions

View File

@ -84,7 +84,7 @@ func listGames(w http.ResponseWriter, req *http.Request) {
for id, g := range games.m {
players := make([]pout, 0)
// TODO - players instead of robots?
for p, _ := range g.players {
for p := range g.players {
for _, r := range p.Robots {
players = append(players, pout{
Name: r.Name,

View File

@ -311,7 +311,7 @@ func (r *Robot) Tick(g *game) {
func (r *Robot) scan(g *game) {
r.Scanners = r.Scanners[:0]
for player, _ := range g.players {
for player := range g.players {
for _, bot := range player.Robots {
if bot.Id == r.Id || bot.Health <= 0 {
continue
@ -327,7 +327,7 @@ func (r *Robot) scan(g *game) {
}
}
for proj, _ := range g.projectiles {
for proj := range g.projectiles {
if proj.Owner == r {
continue
}