REFACTOR: Replace if statement with null-propagating code.

This commit is contained in:
2017-12-21 17:45:39 +00:00
parent 9a0259fe5c
commit 9083dc4c30
36 changed files with 72 additions and 144 deletions

View File

@@ -104,11 +104,9 @@ namespace DiscImageChef.Decoders.SCSI
public static ModePage_0E? DecodeModePage_0E(byte[] pageResponse)
{
if(pageResponse == null) return null;
if((pageResponse?[0] & 0x40) == 0x40) return null;
if((pageResponse[0] & 0x40) == 0x40) return null;
if((pageResponse[0] & 0x3F) != 0x0E) return null;
if((pageResponse?[0] & 0x3F) != 0x0E) return null;
if(pageResponse[1] + 2 != pageResponse.Length) return null;