Avoid some minor allocations.
- Don't call string.Format in Actor.ToString since it gets called often, instead prefer a simple concat. - In HiddenUnderFog.IsVisible, avoid a needless level of lambda indirection.
This commit is contained in:
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
public bool IsVisible(Actor self, Player byPlayer)
|
||||
{
|
||||
return byPlayer == null || Shroud.GetVisOrigins(self).Any(o => byPlayer.Shroud.IsVisible(o));
|
||||
return byPlayer == null || Shroud.GetVisOrigins(self).Any(byPlayer.Shroud.IsVisible);
|
||||
}
|
||||
|
||||
public IEnumerable<IRenderable> ModifyRender(Actor self, WorldRenderer wr, IEnumerable<IRenderable> r)
|
||||
|
||||
Reference in New Issue
Block a user