mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-14 12:12:34 -04:00
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 9a61049f88)
Conflicts:
src/server/game/Server/Packets/TicketPackets.cpp
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user