Core/Phases: Use a O(n) operation when comparing phases instead of a O(n^2) one

This commit is contained in:
Subv
2014-06-01 23:06:17 -05:00
parent 18924654a3
commit 226f1dedb4

View File

@@ -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