Change throw exceptions to use nameof in parameter

This commit is contained in:
teinarss
2021-02-28 17:35:36 +01:00
committed by abcdefg30
parent 53b781960c
commit ed295ae315
30 changed files with 46 additions and 46 deletions

View File

@@ -158,10 +158,10 @@ namespace OpenRA.Mods.Cnc.FileSystem
static uint[] ReadBlocks(Stream s, long offset, int count)
{
if (offset < 0)
throw new ArgumentOutOfRangeException("offset", "Non-negative number required.");
throw new ArgumentOutOfRangeException(nameof(offset), "Non-negative number required.");
if (count < 0)
throw new ArgumentOutOfRangeException("count", "Non-negative number required.");
throw new ArgumentOutOfRangeException(nameof(count), "Non-negative number required.");
if (offset + (count * 2) > s.Length)
throw new ArgumentException("Bytes to read {0} and offset {1} greater than stream length {2}.".F(count * 2, offset, s.Length));