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