mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-29 13:22:48 +01:00
Core/Phases: Use a O(n) operation when comparing phases instead of a O(n^2) one
This commit is contained in:
@@ -2869,10 +2869,7 @@ bool WorldObject::IsInPhase(WorldObject const* obj) const
|
||||
if (obj->GetPhases().empty() && IsInPhase(169))
|
||||
return true;
|
||||
|
||||
for (auto phase : _phases)
|
||||
if (obj->IsInPhase(phase))
|
||||
return true;
|
||||
return false;
|
||||
return Trinity::Containers::Intersects(_phases.begin(), _phases.end(), obj->GetPhases().begin(), obj->GetPhases().end());
|
||||
}
|
||||
|
||||
bool WorldObject::InSamePhase(WorldObject const* obj) const
|
||||
|
||||
Reference in New Issue
Block a user