servergame GetNumJoinsPerPlayer optimized

This commit is contained in:
Kai Philipp
2016-07-30 19:05:16 +02:00
parent 35f0521bbd
commit 4682b51e40
2 changed files with 5 additions and 5 deletions
+3 -2
View File
@@ -1181,8 +1181,9 @@ int
ServerGame::GetNumJoinsPerPlayer(const std::string &playerName)
{
int num = 0;
if(m_numJoinsPerPlayer.find(playerName) != m_numJoinsPerPlayer.end()) {
num = m_numJoinsPerPlayer[playerName];
NumJoinsPerPlayerMap::const_iterator pos = m_numJoinsPerPlayer.find(playerName);
if (pos != m_numJoinsPerPlayer.end()) {
num = pos->second;
}
return num;
}