Change some Exts.MakeArray calls into Enumerable.Range.

Avoid creating some arrays where sequences will suffice.
This commit is contained in:
RoosterDragon
2014-11-29 02:20:42 +00:00
parent 6ebaebd1d1
commit dc2e44da36
4 changed files with 10 additions and 7 deletions

View File

@@ -9,6 +9,7 @@
#endregion
using System.Collections.Generic;
using System.Linq;
using OpenRA.Traits;
namespace OpenRA.Mods.RA
@@ -57,9 +58,9 @@ namespace OpenRA.Mods.RA
public IEnumerable<PipType> GetPips(Actor self)
{
return Exts.MakeArray(Info.PipCount,
i => (Player.Resources * Info.PipCount > i * Player.ResourceCapacity)
? Info.PipColor : PipType.Transparent);
return Enumerable.Range(0, Info.PipCount).Select(i =>
Player.Resources * Info.PipCount > i * Player.ResourceCapacity
? Info.PipColor : PipType.Transparent);
}
public bool ShouldExplode(Actor self) { return Stored > 0; }