mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
REFACTOR: Invert 'if' statement to reduce nesting.
This commit is contained in:
@@ -43,19 +43,20 @@ namespace DiscImageChef.Devices
|
||||
/// </summary>
|
||||
~Device()
|
||||
{
|
||||
if(fd != null)
|
||||
switch(platformId)
|
||||
{
|
||||
case Interop.PlatformID.Win32NT:
|
||||
Windows.Extern.CloseHandle((SafeFileHandle)fd);
|
||||
break;
|
||||
case Interop.PlatformID.Linux:
|
||||
Linux.Extern.close((int)fd);
|
||||
break;
|
||||
case Interop.PlatformID.FreeBSD:
|
||||
FreeBSD.Extern.cam_close_device((IntPtr)fd);
|
||||
break;
|
||||
}
|
||||
if(fd == null) return;
|
||||
|
||||
switch(platformId)
|
||||
{
|
||||
case Interop.PlatformID.Win32NT:
|
||||
Windows.Extern.CloseHandle((SafeFileHandle)fd);
|
||||
break;
|
||||
case Interop.PlatformID.Linux:
|
||||
Linux.Extern.close((int)fd);
|
||||
break;
|
||||
case Interop.PlatformID.FreeBSD:
|
||||
FreeBSD.Extern.cam_close_device((IntPtr)fd);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user