diff --git a/CD/FullTOC.cs b/CD/FullTOC.cs index c607092d5..080e25e9c 100644 --- a/CD/FullTOC.cs +++ b/CD/FullTOC.cs @@ -334,8 +334,7 @@ public static class FullTOC default: { - if(descriptor.POINT >= 0x01 && - descriptor.POINT <= 0x63) + if(descriptor.POINT is >= 0x01 and <= 0x63) if(descriptor.ADR == 4) sb.AppendFormat("Video track {3} starts at: {0:D2}:{1:D2}:{2:D2}", descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME, @@ -525,8 +524,7 @@ public static class FullTOC default: { - if(descriptor.POINT >= 0x01 && - descriptor.POINT <= 0x40) + if(descriptor.POINT is >= 0x01 and <= 0x40) { sb. AppendFormat("Start time for interval that should be skipped: {0:D2}:{1:D2}:{2:D2}", diff --git a/SCSI/EVPD.cs b/SCSI/EVPD.cs index 0f5497f0d..b56211066 100644 --- a/SCSI/EVPD.cs +++ b/SCSI/EVPD.cs @@ -2214,24 +2214,19 @@ public static class EVPD break; } - if(page.Component != null && - page.Component.Length > 0) + if(page.Component is { Length: > 0 }) sb.AppendFormat("\tComponent: {0}", StringHandlers.CToString(page.Component)).AppendLine(); - if(page.Version != null && - page.Version.Length > 0) + if(page.Version is { Length: > 0 }) sb.AppendFormat("\tVersion: {0}", StringHandlers.CToString(page.Version)).AppendLine(); - if(page.Date != null && - page.Date.Length > 0) + if(page.Date is { Length: > 0 }) sb.AppendFormat("\tDate: {0}", StringHandlers.CToString(page.Date)).AppendLine(); - if(page.Variant != null && - page.Variant.Length > 0) + if(page.Variant is { Length: > 0 }) sb.AppendFormat("\tVariant: {0}", StringHandlers.CToString(page.Variant)).AppendLine(); - if(page.Copyright != null && - page.Copyright.Length > 0) + if(page.Copyright is { Length: > 0 }) sb.AppendFormat("\tCopyright: {0}", StringHandlers.CToString(page.Copyright)).AppendLine(); return sb.ToString(); diff --git a/SCSI/SSC/DensitySupport.cs b/SCSI/SSC/DensitySupport.cs index eaed33621..7b3010aa4 100644 --- a/SCSI/SSC/DensitySupport.cs +++ b/SCSI/SSC/DensitySupport.cs @@ -44,10 +44,7 @@ public static class DensitySupport { public static DensitySupportHeader? DecodeDensity(byte[] response) { - if(response == null) - return null; - - if(response.Length <= 56) + if(response is not { Length: > 56 }) return null; var responseLen = (ushort)((response[0] << 8) + response[1] + 2); @@ -147,10 +144,7 @@ public static class DensitySupport public static MediaTypeSupportHeader? DecodeMediumType(byte[] response) { - if(response == null) - return null; - - if(response.Length <= 60) + if(response is not { Length: > 60 }) return null; var responseLen = (ushort)((response[0] << 8) + response[1] + 2);