mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
General refactor.
This commit is contained in:
@@ -49,8 +49,7 @@ namespace DiscImageChef.Partitions
|
||||
|
||||
public bool GetInformation(IMediaImage imagePlugin, out List<Partition> partitions, ulong sectorOffset)
|
||||
{
|
||||
partitions = new List<Partition>();
|
||||
|
||||
partitions = null;
|
||||
byte[] sector = imagePlugin.ReadSector(sectorOffset);
|
||||
if(sector.Length < 512) return false;
|
||||
|
||||
@@ -63,23 +62,19 @@ namespace DiscImageChef.Partitions
|
||||
|
||||
ulong counter = 0;
|
||||
|
||||
foreach(Partition part in from entry in table.entries
|
||||
let part = new Partition
|
||||
{
|
||||
Start = entry.offset,
|
||||
Offset = (ulong)(entry.offset * sector.Length),
|
||||
Size = entry.size,
|
||||
Length = (ulong)(entry.size * sector.Length),
|
||||
Type = "Rio Karma",
|
||||
Sequence = counter,
|
||||
Scheme = Name
|
||||
}
|
||||
where entry.type == ENTRY_MAGIC
|
||||
select part)
|
||||
{
|
||||
partitions.Add(part);
|
||||
counter++;
|
||||
}
|
||||
partitions = (from entry in table.entries
|
||||
let part = new Partition
|
||||
{
|
||||
Start = entry.offset,
|
||||
Offset = (ulong)(entry.offset * sector.Length),
|
||||
Size = entry.size,
|
||||
Length = (ulong)(entry.size * sector.Length),
|
||||
Type = "Rio Karma",
|
||||
Sequence = counter++,
|
||||
Scheme = Name
|
||||
}
|
||||
where entry.type == ENTRY_MAGIC
|
||||
select part).ToList();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user