mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-19 22:49:39 -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.
This commit is contained in:
@@ -3199,7 +3199,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();
|
||||
}
|
||||
|
||||
@@ -3230,7 +3230,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