mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2025-07-23 00:24:08 +00:00
Exception simplification
This commit is contained in:
@@ -54,10 +54,7 @@ namespace EightBit
|
||||
|
||||
private static byte[] ParseDataRecord(string line, byte count)
|
||||
{
|
||||
if (string.IsNullOrEmpty(line))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(line));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNullOrEmpty(line);
|
||||
|
||||
var requiredLength = 9 + 2 + (count * 2);
|
||||
if (line.Length != requiredLength)
|
||||
@@ -78,10 +75,7 @@ namespace EightBit
|
||||
|
||||
private Tuple<ushort, byte[]>? Parse(string line)
|
||||
{
|
||||
if (string.IsNullOrEmpty(line))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(line));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNullOrEmpty(line);
|
||||
|
||||
var colon = line[..1];
|
||||
if (colon != ":")
|
||||
|
Reference in New Issue
Block a user