diff --git a/OpenRA.Game/Platform.cs b/OpenRA.Game/Platform.cs index e71ae16829..01288879e3 100644 --- a/OpenRA.Game/Platform.cs +++ b/OpenRA.Game/Platform.cs @@ -160,7 +160,7 @@ namespace OpenRA /// Replace special character prefixes with full paths. public static string ResolvePath(params string[] path) { - return ResolvePath(path.Aggregate(Path.Combine)); + return ResolvePath(Path.Combine(path)); } /// diff --git a/OpenRA.Mods.Cnc/FileFormats/XccLocalDatabase.cs b/OpenRA.Mods.Cnc/FileFormats/XccLocalDatabase.cs index 39c5d20572..7658187973 100644 --- a/OpenRA.Mods.Cnc/FileFormats/XccLocalDatabase.cs +++ b/OpenRA.Mods.Cnc/FileFormats/XccLocalDatabase.cs @@ -51,7 +51,7 @@ namespace OpenRA.Mods.Cnc.FileFormats writer.Write(Encoding.ASCII.GetBytes("XCC by Olaf van der Spek")); writer.Write(new byte[] { 0x1A, 0x04, 0x17, 0x27, 0x10, 0x19, 0x80, 0x00 }); - writer.Write(Entries.Aggregate(Entries.Length, (a, b) => a + b.Length) + 52); // Size + writer.Write(Entries.Sum(e => e.Length) + Entries.Length + 52); // Size writer.Write(0); // Type writer.Write(0); // Version writer.Write(0); // Game/Format (0 == TD) diff --git a/OpenRA.Mods.Cnc/UtilityCommands/ImportTSMapCommand.cs b/OpenRA.Mods.Cnc/UtilityCommands/ImportTSMapCommand.cs index b0c3f9788c..f719453184 100644 --- a/OpenRA.Mods.Cnc/UtilityCommands/ImportTSMapCommand.cs +++ b/OpenRA.Mods.Cnc/UtilityCommands/ImportTSMapCommand.cs @@ -313,7 +313,7 @@ namespace OpenRA.Mods.Cnc.UtilityCommands var tileset = Game.ModData.DefaultTileSets[map.Tileset]; var mapSection = file.GetSection("IsoMapPack5"); - var data = Convert.FromBase64String(mapSection.Aggregate(string.Empty, (a, b) => a + b.Value)); + var data = Convert.FromBase64String(string.Concat(mapSection.Select(kvp => kvp.Value))); int cells = (fullSize.X * 2 - 1) * fullSize.Y; int lzoPackSize = cells * 11 + 4; // last 4 bytes contains a lzo pack header saying no more data is left var isoMapPack = new byte[lzoPackSize]; @@ -349,13 +349,13 @@ namespace OpenRA.Mods.Cnc.UtilityCommands static void ReadOverlay(Map map, IniFile file, int2 fullSize) { var overlaySection = file.GetSection("OverlayPack"); - var overlayCompressed = Convert.FromBase64String(overlaySection.Aggregate(string.Empty, (a, b) => a + b.Value)); + var overlayCompressed = Convert.FromBase64String(string.Concat(overlaySection.Select(kvp => kvp.Value))); var overlayPack = new byte[1 << 18]; var temp = new byte[1 << 18]; UnpackLCW(overlayCompressed, overlayPack, temp); var overlayDataSection = file.GetSection("OverlayDataPack"); - var overlayDataCompressed = Convert.FromBase64String(overlayDataSection.Aggregate(string.Empty, (a, b) => a + b.Value)); + var overlayDataCompressed = Convert.FromBase64String(string.Concat(overlayDataSection.Select(kvp => kvp.Value))); var overlayDataPack = new byte[1 << 18]; UnpackLCW(overlayDataCompressed, overlayDataPack, temp); diff --git a/OpenRA.Mods.Common/Traits/Power/Player/PowerManager.cs b/OpenRA.Mods.Common/Traits/Power/Player/PowerManager.cs index 7f71afd0b2..e9a322037c 100644 --- a/OpenRA.Mods.Common/Traits/Power/Player/PowerManager.cs +++ b/OpenRA.Mods.Common/Traits/Power/Player/PowerManager.cs @@ -70,7 +70,7 @@ namespace OpenRA.Mods.Common.Traits { int old; powerDrain.TryGetValue(a, out old); // old is 0 if a is not in powerDrain - var amount = a.TraitsImplementing().Where(t => !t.IsTraitDisabled).Aggregate(0, (v, p) => v + p.GetEnabledPower()); + var amount = a.TraitsImplementing().Where(t => !t.IsTraitDisabled).Sum(p => p.GetEnabledPower()); powerDrain[a] = amount; if (amount == old || devMode.UnlimitedPower) return;