Speed up Map.ContainsAllProjectedCellsCovering on flat maps.
This method gets called often via Contains calls. We can significantly speed up the method for flat maps since we know the projection and it is trivial to perform. This avoids an expensive projection lookup.
This commit is contained in:
@@ -767,6 +767,9 @@ namespace OpenRA
|
||||
|
||||
bool ContainsAllProjectedCellsCovering(MPos uv)
|
||||
{
|
||||
if (MaximumTerrainHeight == 0)
|
||||
return Contains((PPos)uv);
|
||||
|
||||
foreach (var puv in ProjectedCellsCovering(uv))
|
||||
if (!Contains(puv))
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user