mirror of
https://github.com/aaru-dps/Aaru.git
synced 2026-07-08 18:16:24 +00:00
Address code quality issues
This commit is contained in:
@@ -7,6 +7,7 @@ using Aaru.CommonTypes.Interfaces;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
using Aaru.Filesystems;
|
||||
using FileAttributes = Aaru.CommonTypes.Structs.FileAttributes;
|
||||
using System.Linq;
|
||||
|
||||
namespace Aaru.Core.Image;
|
||||
|
||||
@@ -28,11 +29,8 @@ internal static class AacsHddvdExtentResolver
|
||||
IReadOnlyFilesystem udfRo = null;
|
||||
UDF udf = null;
|
||||
|
||||
foreach(IFilesystem fs in plugins.Filesystems.Values)
|
||||
foreach(UDF udfPlugin in plugins.Filesystems.Values.OfType<UDF>())
|
||||
{
|
||||
if(fs is not UDF udfPlugin)
|
||||
continue;
|
||||
|
||||
Partition wholeImage = new()
|
||||
{
|
||||
Start = 0,
|
||||
@@ -165,11 +163,8 @@ internal static class AacsHddvdExtentResolver
|
||||
if(errno != ErrorNumber.NoError)
|
||||
return errno;
|
||||
|
||||
foreach((ulong startSector, uint sectorCount) extent in extents)
|
||||
foreach((ulong startSector, uint sectorCount) extent in extents.Where(e => e.sectorCount != 0))
|
||||
{
|
||||
if(extent.sectorCount == 0)
|
||||
continue;
|
||||
|
||||
ranges.Add(new LbaRange
|
||||
{
|
||||
Start = extent.startSector,
|
||||
|
||||
@@ -5,6 +5,7 @@ using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
using Aaru.Decryption.Aacs;
|
||||
using System.Linq;
|
||||
|
||||
namespace Aaru.Core.Image;
|
||||
|
||||
@@ -319,12 +320,9 @@ public static class AacsKeyResolver
|
||||
|
||||
foreach(Partition partition in Partitions.GetAll(image))
|
||||
{
|
||||
foreach(IFilesystem fs in plugins.Filesystems.Values)
|
||||
foreach(IReadOnlyFilesystem rofs in plugins.Filesystems.Values.OfType<IReadOnlyFilesystem>())
|
||||
{
|
||||
if(fs is not IReadOnlyFilesystem rofs)
|
||||
continue;
|
||||
|
||||
if(!fs.Identify(image, partition))
|
||||
if(!rofs.Identify(image, partition))
|
||||
continue;
|
||||
|
||||
if(rofs.Mount(image, partition, encoding, null, null) != ErrorNumber.NoError)
|
||||
|
||||
Reference in New Issue
Block a user