Permalink
Browse files

[12066] Optimize some parts for ++C

  • Loading branch information...
stfx authored and Schmoozerd committed Jul 21, 2012
1 parent 43cdd3c commit 2ee521a5eaf438a3e0665e457923b163a7b62380
Showing with 163 additions and 163 deletions.
  1. +4 −4 src/game/AchievementMgr.cpp
  2. +1 −1 src/game/BattleGround.cpp
  3. +6 −6 src/game/BattleGroundAV.cpp
  4. +15 −15 src/game/BattleGroundMgr.cpp
  5. +4 −4 src/game/CalendarHandler.cpp
  6. +2 −2 src/game/CellImpl.h
  7. +1 −1 src/game/Chat.cpp
  8. +1 −1 src/game/Corpse.cpp
  9. +1 −1 src/game/CreatureEventAI.cpp
  10. +1 −1 src/game/CreatureEventAIMgr.cpp
  11. +1 −1 src/game/DBCStores.cpp
  12. +3 −3 src/game/GameEventMgr.cpp
  13. +7 −7 src/game/Item.cpp
  14. +5 −5 src/game/Level2.cpp
  15. +9 −9 src/game/Level3.cpp
  16. +1 −1 src/game/MapPersistentStateMgr.cpp
  17. +12 −12 src/game/ObjectMgr.cpp
  18. +6 −6 src/game/PathFinder.cpp
  19. +3 −3 src/game/Pet.cpp
  20. +4 −4 src/game/Player.cpp
  21. +1 −1 src/game/PlayerDump.cpp
  22. +1 −1 src/game/QueryHandler.cpp
  23. +3 −3 src/game/ReputationMgr.cpp
  24. +2 −2 src/game/SocialMgr.cpp
  25. +1 −1 src/game/Spell.h
  26. +10 −10 src/game/SpellAuras.cpp
  27. +1 −1 src/game/SpellAuras.h
  28. +1 −1 src/game/SpellEffects.cpp
  29. +2 −2 src/game/SpellMgr.cpp
  30. +1 −1 src/game/Transports.cpp
  31. +1 −1 src/game/WaypointManager.cpp
  32. +5 −5 src/game/vmap/BIH.cpp
  33. +6 −6 src/game/vmap/BIH.h
  34. +3 −3 src/game/vmap/TileAssembler.cpp
  35. +1 −1 src/mangosd/CliRunnable.cpp
  36. +16 −16 src/mangosd/soapC.cpp
  37. +2 −2 src/realmd/PatchHandler.cpp
  38. +1 −1 src/shared/Auth/BigNumber.cpp
  39. +2 −2 src/shared/Database/DBCFileLoader.cpp
  40. +1 −1 src/shared/Database/DatabaseMysql.cpp
  41. +1 −1 src/shared/Database/DatabasePostgre.cpp
  42. +2 −2 src/shared/Database/QueryResultMysql.cpp
  43. +2 −2 src/shared/Database/QueryResultPostgre.cpp
  44. +2 −2 src/shared/Database/SqlOperations.cpp
  45. +3 −3 src/shared/ProgressBar.cpp
  46. +1 −1 src/shared/ServiceWin32.cpp
  47. +3 −3 src/shared/WheatyExceptionReport.cpp
  48. +1 −1 src/shared/revision_nr.h
@@ -1019,7 +1019,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
uint32 counter = 0;
for (QuestStatusMap::const_iterator itr = GetPlayer()->getQuestStatusMap().begin(); itr != GetPlayer()->getQuestStatusMap().end(); ++itr)
if (itr->second.m_rewarded)
counter++;
++counter;
change = counter;
progressType = PROGRESS_HIGHEST;
break;
@@ -1035,7 +1035,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
{
Quest const* quest = sObjectMgr.GetQuestTemplate(itr->first);
if (itr->second.m_rewarded && quest->GetZoneOrSort() >= 0 && uint32(quest->GetZoneOrSort()) == achievementCriteria->complete_quests_in_zone.zoneID)
counter++;
++counter;
}
change = counter;
progressType = PROGRESS_HIGHEST;
@@ -1548,7 +1548,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter)
{
if (skillIter->second->skillId == achievementCriteria->learn_skillline_spell.skillLine)
spellCount++;
++spellCount;
}
}
change = spellCount;
@@ -1612,7 +1612,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
SkillLineAbilityMapBounds bounds = sSpellMgr.GetSkillLineAbilityMapBounds(spellIter->first);
for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter)
if (skillIter->second->skillId == achievementCriteria->learn_skill_line.skillLine)
spellCount++;
++spellCount;
}
change = spellCount;
progressType = PROGRESS_HIGHEST;
@@ -1691,7 +1691,7 @@ void BattleGround::HandleTriggerBuff(ObjectGuid go_guid)
// TODO this can be done when poolsystem works for instances
int32 index = m_BgObjects.size() - 1;
while (index >= 0 && m_BgObjects[index] != go_guid)
index--;
--index;
if (index < 0)
{
sLog.outError("BattleGround (Type: %u) has buff trigger %s GOType: %u but it hasn't that object in its internal data",
@@ -242,7 +242,7 @@ void BattleGroundAV::Update(uint32 diff)
return;
// add points from mine owning, and look if the neutral team can reclaim the mine
for (uint8 mine = 0; mine < BG_AV_MAX_MINES; mine++)
for (uint8 mine = 0; mine < BG_AV_MAX_MINES; ++mine)
{
if (m_Mine_Owner[mine] != BG_AV_TEAM_NEUTRAL)
{
@@ -325,7 +325,7 @@ void BattleGroundAV::EndBattleGround(Team winner)
// now we have the values give the honor/reputation to the teams:
Team team[BG_TEAMS_COUNT] = { ALLIANCE, HORDE };
uint32 faction[BG_TEAMS_COUNT] = { BG_AV_FACTION_A, BG_AV_FACTION_H };
for (uint32 i = 0; i < BG_TEAMS_COUNT; i++)
for (uint32 i = 0; i < BG_TEAMS_COUNT; ++i)
{
if (tower_survived[i])
{
@@ -619,7 +619,7 @@ void BattleGroundAV::FillInitialWorldStates(WorldPacket& data, uint32& count)
bool stateok;
for (uint32 i = BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i)
{
for (uint8 j = 0; j < BG_AV_MAX_STATES; j++)
for (uint8 j = 0; j < BG_AV_MAX_STATES; ++j)
{
stateok = (m_Nodes[i].State == j);
FillInitialWorldState(data, count, BG_AV_NodeWorldStates[i][GetWorldStateType(j, BG_AV_TEAM_ALLIANCE)],
@@ -794,16 +794,16 @@ void BattleGroundAV::Reset()
m_RepSurviveTower = (isBGWeekend) ? BG_AV_REP_SURVIVING_TOWER_HOLIDAY : BG_AV_REP_SURVIVING_TOWER;
m_RepOwnedMine = (isBGWeekend) ? BG_AV_REP_OWNED_MINE_HOLIDAY : BG_AV_REP_OWNED_MINE;
for (uint8 i = 0; i < BG_TEAMS_COUNT; i++)
for (uint8 i = 0; i < BG_TEAMS_COUNT; ++i)
{
for (uint8 j = 0; j < 9; j++) // 9 quests getting tracked
for (uint8 j = 0; j < 9; ++j) // 9 quests getting tracked
m_Team_QuestStatus[i][j] = 0;
m_TeamScores[i] = BG_AV_SCORE_INITIAL_POINTS;
m_IsInformedNearLose[i] = false;
m_ActiveEvents[BG_AV_NodeEventCaptainDead_A + i] = BG_EVENT_NONE;
}
for (uint8 i = 0; i < BG_AV_MAX_MINES; i++)
for (uint8 i = 0; i < BG_AV_MAX_MINES; ++i)
{
m_Mine_Owner[i] = BG_AV_TEAM_NEUTRAL;
m_Mine_PrevOwner[i] = m_Mine_Owner[i];
@@ -172,7 +172,7 @@ GroupQueueInfo* BattleGroundQueue::AddGroup(Player* leader, Group* grp, BattleGr
index += BG_TEAMS_COUNT; // BG_QUEUE_PREMADE_* -> BG_QUEUE_NORMAL_*
if (ginfo->GroupTeam == HORDE)
index++; // BG_QUEUE_*_ALLIANCE -> BG_QUEUE_*_HORDE
++index; // BG_QUEUE_*_ALLIANCE -> BG_QUEUE_*_HORDE
DEBUG_LOG("Adding Group to BattleGroundQueue bgTypeId : %u, bracket_id : %u, index : %u", BgTypeId, bracketId, index);
@@ -520,13 +520,13 @@ void BattleGroundQueue::FillPlayersToBG(BattleGround* bg, BattleGroundBracketId
uint32 aliCount = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE].size();
//index to queue which group is current
uint32 aliIndex = 0;
for (; aliIndex < aliCount && m_SelectionPools[BG_TEAM_ALLIANCE].AddGroup((*Ali_itr), aliFree); aliIndex++)
for (; aliIndex < aliCount && m_SelectionPools[BG_TEAM_ALLIANCE].AddGroup((*Ali_itr), aliFree); ++aliIndex)
++Ali_itr;
//the same thing for horde
GroupsQueueType::const_iterator Horde_itr = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_HORDE].begin();
uint32 hordeCount = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_HORDE].size();
uint32 hordeIndex = 0;
for (; hordeIndex < hordeCount && m_SelectionPools[BG_TEAM_HORDE].AddGroup((*Horde_itr), hordeFree); hordeIndex++)
for (; hordeIndex < hordeCount && m_SelectionPools[BG_TEAM_HORDE].AddGroup((*Horde_itr), hordeFree); ++hordeIndex)
++Horde_itr;
//if ofc like BG queue invitation is set in config, then we are happy
@@ -552,7 +552,7 @@ void BattleGroundQueue::FillPlayersToBG(BattleGround* bg, BattleGroundBracketId
//kick alliance group, add to pool new group if needed
if (m_SelectionPools[BG_TEAM_ALLIANCE].KickGroup(diffHorde - diffAli))
{
for (; aliIndex < aliCount && m_SelectionPools[BG_TEAM_ALLIANCE].AddGroup((*Ali_itr), (aliFree >= diffHorde) ? aliFree - diffHorde : 0); aliIndex++)
for (; aliIndex < aliCount && m_SelectionPools[BG_TEAM_ALLIANCE].AddGroup((*Ali_itr), (aliFree >= diffHorde) ? aliFree - diffHorde : 0); ++aliIndex)
++Ali_itr;
}
//if ali selection is already empty, then kick horde group, but if there are less horde than ali in bg - break;
@@ -568,7 +568,7 @@ void BattleGroundQueue::FillPlayersToBG(BattleGround* bg, BattleGroundBracketId
//kick horde group, add to pool new group if needed
if (m_SelectionPools[BG_TEAM_HORDE].KickGroup(diffAli - diffHorde))
{
for (; hordeIndex < hordeCount && m_SelectionPools[BG_TEAM_HORDE].AddGroup((*Horde_itr), (hordeFree >= diffAli) ? hordeFree - diffAli : 0); hordeIndex++)
for (; hordeIndex < hordeCount && m_SelectionPools[BG_TEAM_HORDE].AddGroup((*Horde_itr), (hordeFree >= diffAli) ? hordeFree - diffAli : 0); ++hordeIndex)
++Horde_itr;
}
if (!m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount())
@@ -609,7 +609,7 @@ bool BattleGroundQueue::CheckPremadeMatch(BattleGroundBracketId bracket_id, uint
//add groups/players from normal queue to size of bigger group
uint32 maxPlayers = std::max(m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount(), m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount());
GroupsQueueType::const_iterator itr;
for (uint32 i = 0; i < BG_TEAMS_COUNT; i++)
for (uint32 i = 0; i < BG_TEAMS_COUNT; ++i)
{
for (itr = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + i].begin(); itr != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + i].end(); ++itr)
{
@@ -627,7 +627,7 @@ bool BattleGroundQueue::CheckPremadeMatch(BattleGroundBracketId bracket_id, uint
// if first is invited to BG and seconds timer expired, but we can ignore it, because players have only 80 seconds to click to enter bg
// and when they click or after 80 seconds the queue info is removed from queue
uint32 time_before = WorldTimer::getMSTime() - sWorld.getConfig(CONFIG_UINT32_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH);
for (uint32 i = 0; i < BG_TEAMS_COUNT; i++)
for (uint32 i = 0; i < BG_TEAMS_COUNT; ++i)
{
if (!m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE + i].empty())
{
@@ -648,7 +648,7 @@ bool BattleGroundQueue::CheckPremadeMatch(BattleGroundBracketId bracket_id, uint
bool BattleGroundQueue::CheckNormalMatch(BattleGround* bg_template, BattleGroundBracketId bracket_id, uint32 minPlayers, uint32 maxPlayers)
{
GroupsQueueType::const_iterator itr_team[BG_TEAMS_COUNT];
for (uint32 i = 0; i < BG_TEAMS_COUNT; i++)
for (uint32 i = 0; i < BG_TEAMS_COUNT; ++i)
{
itr_team[i] = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + i].begin();
for (; itr_team[i] != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + i].end(); ++(itr_team[i]))
@@ -863,7 +863,7 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BattleGroundBracketI
return;
}
//invite those selection pools
for (uint32 i = 0; i < BG_TEAMS_COUNT; i++)
for (uint32 i = 0; i < BG_TEAMS_COUNT; ++i)
for (GroupsQueueType::const_iterator citr = m_SelectionPools[BG_TEAM_ALLIANCE + i].SelectedGroups.begin(); citr != m_SelectionPools[BG_TEAM_ALLIANCE + i].SelectedGroups.end(); ++citr)
InviteGroupToBG((*citr), bg2, (*citr)->GroupTeam);
//start bg
@@ -890,7 +890,7 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BattleGroundBracketI
}
// invite those selection pools
for (uint32 i = 0; i < BG_TEAMS_COUNT; i++)
for (uint32 i = 0; i < BG_TEAMS_COUNT; ++i)
for (GroupsQueueType::const_iterator citr = m_SelectionPools[BG_TEAM_ALLIANCE + i].SelectedGroups.begin(); citr != m_SelectionPools[BG_TEAM_ALLIANCE + i].SelectedGroups.end(); ++citr)
InviteGroupToBG((*citr), bg2, (*citr)->GroupTeam);
// start bg
@@ -940,7 +940,7 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BattleGroundBracketI
//optimalization : --- we dont need to use selection_pools - each update we select max 2 groups
for (uint32 i = BG_QUEUE_PREMADE_ALLIANCE; i < BG_QUEUE_NORMAL_ALLIANCE; i++)
for (uint32 i = BG_QUEUE_PREMADE_ALLIANCE; i < BG_QUEUE_NORMAL_ALLIANCE; ++i)
{
// take the group that joined first
itr_team[i] = m_QueuedGroups[bracket_id][i].begin();
@@ -1127,7 +1127,7 @@ void BGQueueRemoveEvent::Abort(uint64 /*e_time*/)
BattleGroundMgr::BattleGroundMgr() : m_AutoDistributionTimeChecker(0), m_ArenaTesting(false)
{
for (uint32 i = BATTLEGROUND_TYPE_NONE; i < MAX_BATTLEGROUND_TYPE_ID; i++)
for (uint32 i = BATTLEGROUND_TYPE_NONE; i < MAX_BATTLEGROUND_TYPE_ID; ++i)
m_BattleGrounds[i].clear();
m_NextRatingDiscardUpdate = sWorld.getConfig(CONFIG_UINT32_ARENA_RATING_DISCARD_TIMER);
m_Testing = false;
@@ -1168,7 +1168,7 @@ void BattleGroundMgr::Update(uint32 diff)
//release lock
}
for (uint8 i = 0; i < scheduled.size(); i++)
for (uint8 i = 0; i < scheduled.size(); ++i)
{
uint32 arenaRating = scheduled[i] >> 32;
ArenaType arenaType = ArenaType(scheduled[i] >> 24 & 255);
@@ -1430,7 +1430,7 @@ BattleGround* BattleGroundMgr::GetBattleGround(uint32 InstanceID, BattleGroundTy
BattleGroundSet::iterator itr;
if (bgTypeId == BATTLEGROUND_TYPE_NONE)
{
for (uint32 i = BATTLEGROUND_AV; i < MAX_BATTLEGROUND_TYPE_ID; i++)
for (uint32 i = BATTLEGROUND_AV; i < MAX_BATTLEGROUND_TYPE_ID; ++i)
{
itr = m_BattleGrounds[i].find(InstanceID);
if (itr != m_BattleGrounds[i].end())
@@ -1986,7 +1986,7 @@ void BattleGroundMgr::ScheduleQueueUpdate(uint32 arenaRating, ArenaType arenaTyp
//we will use only 1 number created of bgTypeId and bracket_id
uint64 schedule_id = ((uint64)arenaRating << 32) | (arenaType << 24) | (bgQueueTypeId << 16) | (bgTypeId << 8) | bracket_id;
bool found = false;
for (uint8 i = 0; i < m_QueueUpdateScheduler.size(); i++)
for (uint8 i = 0; i < m_QueueUpdateScheduler.size(); ++i)
{
if (m_QueueUpdateScheduler[i] == schedule_id)
{
@@ -73,13 +73,13 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/)
data << uint32(0); // Holidays.dbc priority
data << uint32(0); // Holidays.dbc calendarFilterType
for(uint32 j = 0; j < 26; j++)
for(uint32 j = 0; j < 26; ++j)
data << uint32(0); // Holidays.dbc date
for(uint32 j = 0; j < 10; j++)
for(uint32 j = 0; j < 10; ++j)
data << uint32(0); // Holidays.dbc duration
for(uint32 j = 0; j < 10; j++)
for(uint32 j = 0; j < 10; ++j)
data << uint32(0); // Holidays.dbc calendarFlags
data << ""; // Holidays.dbc textureFilename
@@ -139,7 +139,7 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recv_data)
// {
// uint8 unk12,unk13;
// ObjectGuid guid;
// for (int i=0;i<count;i++)
// for (int i = 0; i < count; ++i)
// {
// recv_data >> guid.ReadAsPacked();
// recv_data >> (uint8)unk12;
View
@@ -102,9 +102,9 @@ Cell::Visit(const CellPair& standing_cell, TypeContainerVisitor<T, CONTAINER>& v
m.Visit(*this, visitor);
// loop the cell range
for (uint32 x = begin_cell.x_coord; x <= end_cell.x_coord; x++)
for (uint32 x = begin_cell.x_coord; x <= end_cell.x_coord; ++x)
{
for (uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; y++)
for (uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; ++y)
{
CellPair cell_pair(x, y);
//lets skip standing cell since we already visited it
View
@@ -1574,7 +1574,7 @@ bool ChatHandler::isValidChatMessage(const char* message)
case 'c':
color = 0;
// validate color, expect 8 hex chars
for (int i = 0; i < 8; i++)
for (int i = 0; i < 8; ++i)
{
char c;
reader >> c;
View
@@ -202,7 +202,7 @@ bool Corpse::LoadFromDB(uint32 lowguid, Field* fields)
// Load equipment
Tokens data = StrSplit(fields[16].GetCppString(), " ");
for (uint8 slot = 0; slot < EQUIPMENT_SLOT_END; slot++)
for (uint8 slot = 0; slot < EQUIPMENT_SLOT_END; ++slot)
{
uint32 visualbase = slot * 2;
uint32 item_id = GetUInt32ValueFromArray(data, visualbase);
@@ -392,7 +392,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction
{
// amount of real actions
uint32 count = 0;
for (uint32 j = 0; j < MAX_ACTIONS; j++)
for (uint32 j = 0; j < MAX_ACTIONS; ++j)
if (pHolder.Event.action[j].type != ACTION_T_NONE)
++count;
@@ -489,7 +489,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
break;
}
for (uint32 j = 0; j < MAX_ACTIONS; j++)
for (uint32 j = 0; j < MAX_ACTIONS; ++j)
{
uint16 action_type = fields[10 + (j * 4)].GetUInt16();
if (action_type >= ACTION_T_END)
View
@@ -541,7 +541,7 @@ void LoadDBCStores(const std::string& dataPath)
{
TalentEntry const* talentInfo = sTalentStore.LookupEntry(i);
if (!talentInfo) continue;
for (int j = 0; j < MAX_TALENT_RANK; j++)
for (int j = 0; j < MAX_TALENT_RANK; ++j)
if (talentInfo->RankID[j])
sTalentSpellPosMap[talentInfo->RankID[j]] = TalentSpellPos(i, j);
}
@@ -983,7 +983,7 @@ void GameEventMgr::SendEventMails(int16 event_id)
template <>
int16 GameEventMgr::GetGameEventId<Creature>(uint32 guid_or_poolid)
{
for (uint16 i = 0; i < mGameEventCreatureGuids.size(); i++) // 0 <= i <= 2*(S := mGameEvent.size()) - 2
for (uint16 i = 0; i < mGameEventCreatureGuids.size(); ++i) // 0 <= i <= 2*(S := mGameEvent.size()) - 2
for (GuidList::const_iterator itr = mGameEventCreatureGuids[i].begin(); itr != mGameEventCreatureGuids[i].end(); ++itr)
if (*itr == guid_or_poolid)
return i + 1 - mGameEvent.size(); // -S *1 + 1 <= . <= 1*S - 1
@@ -994,7 +994,7 @@ int16 GameEventMgr::GetGameEventId<Creature>(uint32 guid_or_poolid)
template <>
int16 GameEventMgr::GetGameEventId<GameObject>(uint32 guid_or_poolid)
{
for (uint16 i = 0; i < mGameEventGameobjectGuids.size(); i++)
for (uint16 i = 0; i < mGameEventGameobjectGuids.size(); ++i)
for (GuidList::const_iterator itr = mGameEventGameobjectGuids[i].begin(); itr != mGameEventGameobjectGuids[i].end(); ++itr)
if (*itr == guid_or_poolid)
return i + 1 - mGameEvent.size(); // -S *1 + 1 <= . <= 1*S - 1
@@ -1005,7 +1005,7 @@ int16 GameEventMgr::GetGameEventId<GameObject>(uint32 guid_or_poolid)
template <>
int16 GameEventMgr::GetGameEventId<Pool>(uint32 guid_or_poolid)
{
for (uint16 i = 0; i < mGameEventSpawnPoolIds.size(); i++)
for (uint16 i = 0; i < mGameEventSpawnPoolIds.size(); ++i)
for (IdList::const_iterator itr = mGameEventSpawnPoolIds[i].begin(); itr != mGameEventSpawnPoolIds[i].end(); ++itr)
if (*itr == guid_or_poolid)
return i;
Oops, something went wrong.

2 comments on commit 2ee521a

@krofna

This comment has been minimized.

krofna replied Jul 21, 2012

I thought compilers do this for you :D

@VladimirMangos

This comment has been minimized.

VladimirMangos replied Jul 21, 2012

For true int-like types we can sure in it, but in general use a++ not as expression part is bad code style.
Also for more advanced iterators for complier can be hard do same optimization.

Please sign in to comment.