Core/Game: Fix some issues detected by static analysis.

* Possible inefficient checking for 'list' emptiness.

* Variable '_scheduledScripts' is assigned in constructor body.
  Consider performing initialization in initialization list.

* Variable 'Text' is assigned in constructor body.
  Consider performing initialization in initialization list.

* Possible inefficient checking for 'm_loadedScripts' emptiness.

(cherry picked from commit 9a61049f88835fd6bdb75905f042583d038d0667)

Conflicts:
	src/server/game/Server/Packets/TicketPackets.cpp
This commit is contained in:
Naios authored and Nayd committed 2015-03-18 01:13:47 +00:00
1 parent a38945a3b3
commit 301ec0be56
3 files changed
+4 -5

No files matched your search

@@ -3167,7 +3167,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
std::list<Creature*> list;
me->GetCreatureListWithEntryInGrid(list, e.event.distance.entry, (float)e.event.distance.dist);
if (list.size() > 0)
if (!list.empty())
creature = list.front();
}
@@ -3198,7 +3198,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
std::list<GameObject*> list;
me->GetGameObjectListWithEntryInGrid(list, e.event.distance.entry, (float)e.event.distance.dist);
if (list.size() > 0)
if (!list.empty())
gameobject = list.front();
}