Removed uneccesary vector copy.
This commit is contained in:
parent
4813637a37
commit
e7cc868c85
@ -66,7 +66,7 @@ class GameSetup
|
||||
/** \brief Get the players that are in the game
|
||||
* \return A vector containing pointers on the players profiles.
|
||||
*/
|
||||
std::vector<NetworkPlayerProfile*> getPlayers() { return m_players; }
|
||||
const std::vector<NetworkPlayerProfile*>& getPlayers() { return m_players; }
|
||||
int getPlayerCount() { return (int)m_players.size(); }
|
||||
/*! \brief Get a network player profile matching a universal id.
|
||||
* \param id : Global id of the player (the one in the SQL database)
|
||||
|
@ -25,7 +25,7 @@ StartGameProtocol::StartGameProtocol(GameSetup* game_setup)
|
||||
: Protocol(PROTOCOL_START_GAME)
|
||||
{
|
||||
m_game_setup = game_setup;
|
||||
std::vector<NetworkPlayerProfile*> players = m_game_setup->getPlayers();
|
||||
const std::vector<NetworkPlayerProfile*> &players = m_game_setup->getPlayers();
|
||||
for (unsigned int i = 0; i < players.size(); i++)
|
||||
{
|
||||
m_player_states.insert(std::pair<NetworkPlayerProfile*, STATE>(players[i], LOADING));
|
||||
|
Loading…
x
Reference in New Issue
Block a user