Skip to content

Commit

Permalink
Inline out variable declarations.
Browse files Browse the repository at this point in the history
  • Loading branch information
claunia committed Oct 5, 2023
1 parent 6591036 commit 064f149
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 15 deletions.
4 changes: 1 addition & 3 deletions Aaru.Filesystems/AppleMFS/File.cs
Original file line number Diff line number Diff line change
Expand Up @@ -345,13 +345,11 @@ ErrorNumber ReadFile(string path, out byte[] buf, bool resourceFork, bool tags)

do
{
byte[] sectors;

ErrorNumber errno = tags
? _device.
ReadSectorsTag((ulong)((nextBlock - 2) * _sectorsPerBlock) + _volMdb.drAlBlSt + _partitionStart,
(uint)_sectorsPerBlock, SectorTagType.AppleSectorTag,
out sectors)
out byte[] sectors)
: _device.
ReadSectors((ulong)((nextBlock - 2) * _sectorsPerBlock) + _volMdb.drAlBlSt + _partitionStart,
(uint)_sectorsPerBlock, out sectors);
Expand Down
4 changes: 1 addition & 3 deletions Aaru.Filesystems/LisaFS/Extent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,8 @@ ErrorNumber ReadExtentsFile(short fileId, out ExtentFile file)
if(extTag.FileId != (short)(-1 * fileId))
return ErrorNumber.NoSuchFile;

byte[] sector;

errno = _mddf.fsversion == LISA_V1
? _device.ReadSectors(ptr, 2, out sector)
? _device.ReadSectors(ptr, 2, out byte[] sector)
: _device.ReadSector(ptr, out sector);

if(errno != ErrorNumber.NoError)
Expand Down
8 changes: 2 additions & 6 deletions Aaru.Filesystems/LisaFS/File.cs
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,8 @@ ErrorNumber ReadSystemFile(short fileId, out byte[] buf, bool tags)
if(sysTag.FileId != fileId)
continue;

byte[] sector;

errno = !tags
? _device.ReadSector(i, out sector)
? _device.ReadSector(i, out byte[] sector)
: _device.ReadSectorTag(i, SectorTagType.AppleSectorTag, out sector);

if(errno != ErrorNumber.NoError)
Expand Down Expand Up @@ -462,12 +460,10 @@ ErrorNumber ReadFile(short fileId, out byte[] buf, bool tags)

for(var i = 0; i < file.extents.Length; i++)
{
byte[] sector;

ErrorNumber errno = !tags
? _device.
ReadSectors((ulong)file.extents[i].start + _mddf.mddf_block + _volumePrefix,
(uint)file.extents[i].length, out sector)
(uint)file.extents[i].length, out byte[] sector)
: _device.
ReadSectorsTag((ulong)file.extents[i].start + _mddf.mddf_block + _volumePrefix,
(uint)file.extents[i].length, SectorTagType.AppleSectorTag,
Expand Down
4 changes: 1 addition & 3 deletions Aaru.Gui/ViewModels/Windows/ViewSectorViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,8 @@ public double SectorNumber
{
this.RaiseAndSetIfChanged(ref _sectorNumber, value);

byte[] sector;

ErrorNumber errno = LongSectorChecked
? _inputFormat.ReadSectorLong((ulong)SectorNumber, out sector)
? _inputFormat.ReadSectorLong((ulong)SectorNumber, out byte[] sector)
: _inputFormat.ReadSector((ulong)SectorNumber, out sector);

if(errno == ErrorNumber.NoError)
Expand Down

0 comments on commit 064f149

Please sign in to comment.