From 8b3d6b987210eec7f036a8f7efef5676dc4533e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Teuli=C3=A8re?= Date: Wed, 5 Dec 2012 21:23:25 +0100 Subject: [PATCH] Use BOOST_FOREACH instead of an index-based loop --- game/freegame.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/game/freegame.cpp b/game/freegame.cpp index 9d78d15..457d339 100644 --- a/game/freegame.cpp +++ b/game/freegame.cpp @@ -126,11 +126,11 @@ void FreeGame::start() ASSERT(getNPlayers(), "Cannot start a game without any player"); // Set the initial racks of the players - for (unsigned int i = 0; i < getNPlayers(); i++) + BOOST_FOREACH(Player *player, m_players) { const PlayedRack &newRack = - helperSetRackRandom(getPlayer(i).getCurrentRack(), false, RACK_NEW); - Command *pCmd = new PlayerRackCmd(*m_players[i], newRack); + helperSetRackRandom(player->getCurrentRack(), false, RACK_NEW); + Command *pCmd = new PlayerRackCmd(*player, newRack); accessNavigation().addAndExecute(pCmd); }