Inline out variable declarations.

This commit is contained in:
2023-10-05 02:53:20 +01:00
parent 65910360b6
commit 064f149107
4 changed files with 5 additions and 15 deletions

View File

@@ -345,13 +345,11 @@ public sealed partial class AppleMFS
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);

View File

@@ -110,10 +110,8 @@ public sealed partial class LisaFS
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)

View File

@@ -311,10 +311,8 @@ public sealed partial class LisaFS
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)
@@ -462,12 +460,10 @@ public sealed partial class LisaFS
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,

View File

@@ -81,10 +81,8 @@ public sealed class ViewSectorViewModel : ViewModelBase
{
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)