diff --git a/.editorconfig b/.editorconfig index f4eea3711f..543fe960b8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -974,6 +974,9 @@ dotnet_diagnostic.RCS1048.severity = warning # Simplify boolean comparison. dotnet_diagnostic.RCS1049.severity = warning +# Use compound assignment. +dotnet_diagnostic.RCS1058.severity = warning + # Avoid locking on publicly accessible instance. dotnet_diagnostic.RCS1059.severity = warning diff --git a/OpenRA.Game/Support/MersenneTwister.cs b/OpenRA.Game/Support/MersenneTwister.cs index e31bd0ad59..9c217a79a5 100644 --- a/OpenRA.Game/Support/MersenneTwister.cs +++ b/OpenRA.Game/Support/MersenneTwister.cs @@ -79,7 +79,7 @@ namespace OpenRA.Support var y = (mt[i] & 0x80000000) | (mt[(i + 1) % 624] & 0x7fffffff); mt[i] = mt[(i + 397u) % 624u] ^ (y >> 1); if ((y & 1) == 1) - mt[i] = mt[i] ^ 2567483615; + mt[i] ^= 2567483615; } } } diff --git a/OpenRA.Mods.Cnc/FileFormats/BlowfishKeyProvider.cs b/OpenRA.Mods.Cnc/FileFormats/BlowfishKeyProvider.cs index 3c68af3884..2d00dd1bc3 100644 --- a/OpenRA.Mods.Cnc/FileFormats/BlowfishKeyProvider.cs +++ b/OpenRA.Mods.Cnc/FileFormats/BlowfishKeyProvider.cs @@ -149,7 +149,7 @@ namespace OpenRA.Mods.Cnc.FileFormats if (bits == 0) return; for (i = 0; i < len - 1; i++) n[i] = (n[i] >> bits) | (n[i + 1] << (32 - bits)); - n[i] = n[i] >> bits; + n[i] >>= bits; } static void ShlBigNum(uint[] n, int bits, int len) diff --git a/OpenRA.Mods.D2k/Traits/World/BuildableTerrainLayer.cs b/OpenRA.Mods.D2k/Traits/World/BuildableTerrainLayer.cs index 0a4c30f5e5..d8c4cf405f 100644 --- a/OpenRA.Mods.D2k/Traits/World/BuildableTerrainLayer.cs +++ b/OpenRA.Mods.D2k/Traits/World/BuildableTerrainLayer.cs @@ -82,7 +82,7 @@ namespace OpenRA.Mods.D2k.Traits if (world.ActorMap.GetActorsAt(cell).Any(a => a.TraitOrDefault() != null)) return; - strength[cell] = strength[cell] - damage; + strength[cell] -= damage; if (strength[cell] < 1) RemoveTile(cell); }