mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[Refactor] Use collection expressions.
This commit is contained in:
@@ -32,7 +32,6 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
|
||||
@@ -67,8 +66,8 @@ public sealed partial class BlindWrite5 : IOpticalMediaImage
|
||||
|
||||
public BlindWrite5() => _imageInfo = new ImageInfo
|
||||
{
|
||||
ReadableSectorTags = new List<SectorTagType>(),
|
||||
ReadableMediaTags = new List<MediaTagType>(),
|
||||
ReadableSectorTags = [],
|
||||
ReadableMediaTags = [],
|
||||
HasPartitions = true,
|
||||
HasSessions = true,
|
||||
Version = null,
|
||||
|
||||
@@ -255,7 +255,7 @@ public sealed partial class BlindWrite5
|
||||
_dataPath = Encoding.Unicode.GetString(dataPathBytes);
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Data_path_0, _dataPath);
|
||||
|
||||
_dataFiles = new List<DataFile>();
|
||||
_dataFiles = [];
|
||||
|
||||
for(var cD = 0; cD < dataBlockCount; cD++)
|
||||
{
|
||||
@@ -311,7 +311,7 @@ public sealed partial class BlindWrite5
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, "dataFile.unknown3 = {0}", dataFile.Unknown3);
|
||||
}
|
||||
|
||||
_bwSessions = new List<SessionDescriptor>();
|
||||
_bwSessions = [];
|
||||
|
||||
for(var ses = 0; ses < _header.sessions; ses++)
|
||||
{
|
||||
@@ -542,7 +542,7 @@ public sealed partial class BlindWrite5
|
||||
.BlindWrite5_image_ends_after_expected_position_Probably_new_version_with_different_data_Errors_may_occur);
|
||||
}
|
||||
|
||||
_filePaths = new List<DataFileCharacteristics>();
|
||||
_filePaths = [];
|
||||
|
||||
foreach(DataFile dataFile in _dataFiles)
|
||||
{
|
||||
@@ -706,17 +706,12 @@ public sealed partial class BlindWrite5
|
||||
_filePaths.Add(chars);
|
||||
}
|
||||
|
||||
Sessions = new List<Session>();
|
||||
Tracks = new List<Track>();
|
||||
Partitions = new List<Partition>();
|
||||
Sessions = [];
|
||||
Tracks = [];
|
||||
Partitions = [];
|
||||
var fullTocStream = new MemoryStream();
|
||||
|
||||
fullTocStream.Write(new byte[]
|
||||
{
|
||||
0, 0
|
||||
},
|
||||
0,
|
||||
2);
|
||||
fullTocStream.Write([0, 0], 0, 2);
|
||||
|
||||
ulong offsetBytes = 0;
|
||||
_offsetMap = new Dictionary<uint, ulong>();
|
||||
@@ -1684,10 +1679,7 @@ public sealed partial class BlindWrite5
|
||||
case SectorTagType.CdTrackFlags:
|
||||
if(!_trackFlags.TryGetValue((uint)sectorAddress, out byte flag)) return ErrorNumber.NoData;
|
||||
|
||||
buffer = new[]
|
||||
{
|
||||
flag
|
||||
};
|
||||
buffer = [flag];
|
||||
|
||||
return ErrorNumber.NoError;
|
||||
default:
|
||||
|
||||
@@ -53,8 +53,8 @@ public sealed partial class BlindWrite5
|
||||
public bool? VerifySectors(ulong sectorAddress, uint length, out List<ulong> failingLbas,
|
||||
out List<ulong> unknownLbas)
|
||||
{
|
||||
failingLbas = new List<ulong>();
|
||||
unknownLbas = new List<ulong>();
|
||||
failingLbas = [];
|
||||
unknownLbas = [];
|
||||
ErrorNumber errno = ReadSectorsLong(sectorAddress, length, out byte[] buffer);
|
||||
|
||||
if(errno != ErrorNumber.NoError) return null;
|
||||
@@ -89,8 +89,8 @@ public sealed partial class BlindWrite5
|
||||
public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List<ulong> failingLbas,
|
||||
out List<ulong> unknownLbas)
|
||||
{
|
||||
failingLbas = new List<ulong>();
|
||||
unknownLbas = new List<ulong>();
|
||||
failingLbas = [];
|
||||
unknownLbas = [];
|
||||
ErrorNumber errno = ReadSectorsLong(sectorAddress, length, track, out byte[] buffer);
|
||||
|
||||
if(errno != ErrorNumber.NoError) return null;
|
||||
|
||||
Reference in New Issue
Block a user