From d686e59cb71e586c5037716068967400a88f3f95 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Wed, 16 Mar 2022 23:43:36 +0000 Subject: [PATCH] Use Array.Empty --- Aaru.CommonTypes | 2 +- Aaru.Filesystems/AppleDOS/AppleDOS.cs | 3 +-- Aaru.Filesystems/AppleMFS/AppleMFS.cs | 3 +-- Aaru.Filesystems/CPM/CPM.cs | 3 +-- Aaru.Filesystems/FAT/FAT.cs | 3 +-- Aaru.Filesystems/FATX/FATX.cs | 3 +-- Aaru.Filesystems/LisaFS/LisaFS.cs | 3 +-- Aaru.Filesystems/Opera/Opera.cs | 3 +-- Aaru.Filesystems/UCSDPascal/UCSDPascal.cs | 3 +-- Aaru.Images/Alcohol120/Properties.cs | 3 +-- Aaru.Images/Anex86/Properties.cs | 9 +++------ Aaru.Images/Apple2MG/Properties.cs | 9 +++------ Aaru.Images/AppleDOS/Properties.cs | 9 +++------ Aaru.Images/Apridisk/Properties.cs | 6 ++---- Aaru.Images/BLU/Properties.cs | 6 ++---- Aaru.Images/CisCopy/Properties.cs | 9 +++------ Aaru.Images/CloneCD/Properties.cs | 3 +-- Aaru.Images/CopyTape/Properties.cs | 9 +++------ Aaru.Images/DiskCopy42/Properties.cs | 3 +-- Aaru.Images/DriDiskCopy/Properties.cs | 9 +++------ Aaru.Images/MaxiDisk/Properties.cs | 9 +++------ Aaru.Images/NHDr0/Properties.cs | 9 +++------ Aaru.Images/Parallels/Properties.cs | 9 +++------ Aaru.Images/QCOW/Properties.cs | 9 +++------ Aaru.Images/QCOW2/Properties.cs | 9 +++------ Aaru.Images/QED/Properties.cs | 9 +++------ Aaru.Images/RayDIM/Properties.cs | 9 +++------ Aaru.Images/RsIde/Properties.cs | 6 ++---- Aaru.Images/SaveDskF/Properties.cs | 9 +++------ Aaru.Images/T98/Properties.cs | 9 +++------ Aaru.Images/UDIF/Properties.cs | 9 +++------ Aaru.Images/VDI/Properties.cs | 9 +++------ Aaru.Images/VHD/Properties.cs | 9 +++------ Aaru.Images/VMware/Properties.cs | 6 ++---- Aaru.Images/Virtual98/Properties.cs | 9 +++------ Aaru.Images/ZZZRawImage/Properties.cs | 6 ++---- Aaru.Tests/Images/BlockMediaImageTest.cs | 3 +-- Aaru.Tests/Issues/FsExtractHashIssueTest.cs | 3 +-- Aaru.Tests/Issues/FsExtractIssueTest.cs | 6 ++---- Aaru/Commands/Filesystem/ExtractFiles.cs | 6 ++---- Aaru/Commands/Filesystem/Ls.cs | 6 ++---- 41 files changed, 87 insertions(+), 173 deletions(-) diff --git a/Aaru.CommonTypes b/Aaru.CommonTypes index 5e162d61f..2ba38ebee 160000 --- a/Aaru.CommonTypes +++ b/Aaru.CommonTypes @@ -1 +1 @@ -Subproject commit 5e162d61ff94854134501d301284b0ee36dbeb17 +Subproject commit 2ba38ebee33f70be25b3107ab710768fac7ce38f diff --git a/Aaru.Filesystems/AppleDOS/AppleDOS.cs b/Aaru.Filesystems/AppleDOS/AppleDOS.cs index be857cf9a..9f4c7a679 100644 --- a/Aaru.Filesystems/AppleDOS/AppleDOS.cs +++ b/Aaru.Filesystems/AppleDOS/AppleDOS.cs @@ -66,8 +66,7 @@ public sealed partial class AppleDOS : IReadOnlyFilesystem /// public IEnumerable<(string name, Type type, string description)> SupportedOptions => - new (string name, Type type, string description)[] - {}; + Array.Empty<(string name, Type type, string description)>(); /// public Dictionary Namespaces => null; diff --git a/Aaru.Filesystems/AppleMFS/AppleMFS.cs b/Aaru.Filesystems/AppleMFS/AppleMFS.cs index 0be8e8647..54cd97408 100644 --- a/Aaru.Filesystems/AppleMFS/AppleMFS.cs +++ b/Aaru.Filesystems/AppleMFS/AppleMFS.cs @@ -76,8 +76,7 @@ public sealed partial class AppleMFS : IReadOnlyFilesystem // TODO: Implement Finder namespace (requires decoding Desktop database) /// public IEnumerable<(string name, Type type, string description)> SupportedOptions => - new (string name, Type type, string description)[] - {}; + Array.Empty<(string name, Type type, string description)>(); /// public Dictionary Namespaces => null; diff --git a/Aaru.Filesystems/CPM/CPM.cs b/Aaru.Filesystems/CPM/CPM.cs index f9b8e3090..492c87baa 100644 --- a/Aaru.Filesystems/CPM/CPM.cs +++ b/Aaru.Filesystems/CPM/CPM.cs @@ -94,8 +94,7 @@ public sealed partial class CPM : IReadOnlyFilesystem /// public IEnumerable<(string name, Type type, string description)> SupportedOptions => - new (string name, Type type, string description)[] - {}; + Array.Empty<(string name, Type type, string description)>(); /// public Dictionary Namespaces => null; diff --git a/Aaru.Filesystems/FAT/FAT.cs b/Aaru.Filesystems/FAT/FAT.cs index 962d2efcd..29944c05b 100644 --- a/Aaru.Filesystems/FAT/FAT.cs +++ b/Aaru.Filesystems/FAT/FAT.cs @@ -80,8 +80,7 @@ public sealed partial class FAT : IReadOnlyFilesystem /// public IEnumerable<(string name, Type type, string description)> SupportedOptions => - new (string name, Type type, string description)[] - {}; + Array.Empty<(string name, Type type, string description)>(); /// public Dictionary Namespaces => new() diff --git a/Aaru.Filesystems/FATX/FATX.cs b/Aaru.Filesystems/FATX/FATX.cs index a2eff9548..b92853322 100644 --- a/Aaru.Filesystems/FATX/FATX.cs +++ b/Aaru.Filesystems/FATX/FATX.cs @@ -93,8 +93,7 @@ public sealed partial class XboxFatPlugin : IReadOnlyFilesystem /// public IEnumerable<(string name, Type type, string description)> SupportedOptions => - new (string name, Type type, string description)[] - {}; + Array.Empty<(string name, Type type, string description)>(); /// public Dictionary Namespaces => null; diff --git a/Aaru.Filesystems/LisaFS/LisaFS.cs b/Aaru.Filesystems/LisaFS/LisaFS.cs index 5e3995382..ca3943089 100644 --- a/Aaru.Filesystems/LisaFS/LisaFS.cs +++ b/Aaru.Filesystems/LisaFS/LisaFS.cs @@ -66,8 +66,7 @@ public sealed partial class LisaFS : IReadOnlyFilesystem // TODO: Implement Lisa 7/7 namespace (needs decoding {!CATALOG} file) /// public IEnumerable<(string name, Type type, string description)> SupportedOptions => - new (string name, Type type, string description)[] - {}; + Array.Empty<(string name, Type type, string description)>(); /// public Dictionary Namespaces => new() diff --git a/Aaru.Filesystems/Opera/Opera.cs b/Aaru.Filesystems/Opera/Opera.cs index be0d23582..c51ddfb7f 100644 --- a/Aaru.Filesystems/Opera/Opera.cs +++ b/Aaru.Filesystems/Opera/Opera.cs @@ -84,8 +84,7 @@ public sealed partial class OperaFS : IReadOnlyFilesystem /// public IEnumerable<(string name, Type type, string description)> SupportedOptions => - new (string name, Type type, string description)[] - {}; + Array.Empty<(string name, Type type, string description)>(); /// public Dictionary Namespaces => null; diff --git a/Aaru.Filesystems/UCSDPascal/UCSDPascal.cs b/Aaru.Filesystems/UCSDPascal/UCSDPascal.cs index bf02263b1..35ab08c7e 100644 --- a/Aaru.Filesystems/UCSDPascal/UCSDPascal.cs +++ b/Aaru.Filesystems/UCSDPascal/UCSDPascal.cs @@ -86,8 +86,7 @@ public sealed partial class PascalPlugin : IReadOnlyFilesystem /// public IEnumerable<(string name, Type type, string description)> SupportedOptions => - new (string name, Type type, string description)[] - {}; + Array.Empty<(string name, Type type, string description)>(); /// public Dictionary Namespaces => null; diff --git a/Aaru.Images/Alcohol120/Properties.cs b/Aaru.Images/Alcohol120/Properties.cs index 738121470..df0b44f6a 100644 --- a/Aaru.Images/Alcohol120/Properties.cs +++ b/Aaru.Images/Alcohol120/Properties.cs @@ -186,8 +186,7 @@ public sealed partial class Alcohol120 }; /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - new (string name, Type type, string description, object @default)[] - {}; + Array.Empty<(string name, Type type, string description, object @default)>(); /// public IEnumerable KnownExtensions => new[] { diff --git a/Aaru.Images/Anex86/Properties.cs b/Aaru.Images/Anex86/Properties.cs index a16a30efc..0573f61ec 100644 --- a/Aaru.Images/Anex86/Properties.cs +++ b/Aaru.Images/Anex86/Properties.cs @@ -59,11 +59,9 @@ public sealed partial class Anex86 public CICMMetadataType CicmMetadata => null; /// - public IEnumerable SupportedMediaTags => new MediaTagType[] - {}; + public IEnumerable SupportedMediaTags => Array.Empty(); /// - public IEnumerable SupportedSectorTags => new SectorTagType[] - {}; + public IEnumerable SupportedSectorTags => Array.Empty(); // TODO: Test with real hardware to see real supported media /// @@ -84,8 +82,7 @@ public sealed partial class Anex86 }; /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - new (string name, Type type, string description, object @default)[] - {}; + Array.Empty<(string name, Type type, string description, object @default)>(); /// public IEnumerable KnownExtensions => new[] { diff --git a/Aaru.Images/Apple2MG/Properties.cs b/Aaru.Images/Apple2MG/Properties.cs index 4ae75a059..aabbbed8c 100644 --- a/Aaru.Images/Apple2MG/Properties.cs +++ b/Aaru.Images/Apple2MG/Properties.cs @@ -59,11 +59,9 @@ public sealed partial class Apple2Mg public CICMMetadataType CicmMetadata => null; /// - public IEnumerable SupportedMediaTags => new MediaTagType[] - {}; + public IEnumerable SupportedMediaTags => Array.Empty(); /// - public IEnumerable SupportedSectorTags => new SectorTagType[] - {}; + public IEnumerable SupportedSectorTags => Array.Empty(); /// public IEnumerable SupportedMediaTypes => new[] { @@ -74,8 +72,7 @@ public sealed partial class Apple2Mg }; /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - new (string name, Type type, string description, object @default)[] - {}; + Array.Empty<(string name, Type type, string description, object @default)>(); /// public IEnumerable KnownExtensions => new[] { diff --git a/Aaru.Images/AppleDOS/Properties.cs b/Aaru.Images/AppleDOS/Properties.cs index a1472f1b6..6926631ac 100644 --- a/Aaru.Images/AppleDOS/Properties.cs +++ b/Aaru.Images/AppleDOS/Properties.cs @@ -59,11 +59,9 @@ public sealed partial class AppleDos /// public CICMMetadataType CicmMetadata => null; /// - public IEnumerable SupportedMediaTags => new MediaTagType[] - {}; + public IEnumerable SupportedMediaTags => Array.Empty(); /// - public IEnumerable SupportedSectorTags => new SectorTagType[] - {}; + public IEnumerable SupportedSectorTags => Array.Empty(); /// public IEnumerable SupportedMediaTypes => new[] { @@ -71,8 +69,7 @@ public sealed partial class AppleDos }; /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - new (string name, Type type, string description, object @default)[] - {}; + Array.Empty<(string name, Type type, string description, object @default)>(); /// public IEnumerable KnownExtensions => new[] { diff --git a/Aaru.Images/Apridisk/Properties.cs b/Aaru.Images/Apridisk/Properties.cs index 4cc60912f..86826997f 100644 --- a/Aaru.Images/Apridisk/Properties.cs +++ b/Aaru.Images/Apridisk/Properties.cs @@ -59,11 +59,9 @@ public sealed partial class Apridisk public CICMMetadataType CicmMetadata => null; /// - public IEnumerable SupportedMediaTags => new MediaTagType[] - {}; + public IEnumerable SupportedMediaTags => Array.Empty(); /// - public IEnumerable SupportedSectorTags => new SectorTagType[] - {}; + public IEnumerable SupportedSectorTags => Array.Empty(); // TODO: Test with real hardware to see real supported media /// diff --git a/Aaru.Images/BLU/Properties.cs b/Aaru.Images/BLU/Properties.cs index 9598c75ba..ee27f5ca5 100644 --- a/Aaru.Images/BLU/Properties.cs +++ b/Aaru.Images/BLU/Properties.cs @@ -56,8 +56,7 @@ public sealed partial class Blu /// public CICMMetadataType CicmMetadata => null; /// - public IEnumerable SupportedMediaTags => new MediaTagType[] - {}; + public IEnumerable SupportedMediaTags => Array.Empty(); /// public IEnumerable SupportedSectorTags => new[] { @@ -72,8 +71,7 @@ public sealed partial class Blu }; /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - new (string name, Type type, string description, object @default)[] - {}; + Array.Empty<(string name, Type type, string description, object @default)>(); /// public IEnumerable KnownExtensions => new[] { diff --git a/Aaru.Images/CisCopy/Properties.cs b/Aaru.Images/CisCopy/Properties.cs index 0ab93c07d..4666adbe9 100644 --- a/Aaru.Images/CisCopy/Properties.cs +++ b/Aaru.Images/CisCopy/Properties.cs @@ -56,11 +56,9 @@ public sealed partial class CisCopy /// public CICMMetadataType CicmMetadata => null; /// - public IEnumerable SupportedMediaTags => new MediaTagType[] - {}; + public IEnumerable SupportedMediaTags => Array.Empty(); /// - public IEnumerable SupportedSectorTags => new SectorTagType[] - {}; + public IEnumerable SupportedSectorTags => Array.Empty(); // TODO: Test with real hardware to see real supported media /// @@ -71,8 +69,7 @@ public sealed partial class CisCopy }; /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - new (string name, Type type, string description, object @default)[] - {}; + Array.Empty<(string name, Type type, string description, object @default)>(); /// public IEnumerable KnownExtensions => new[] { diff --git a/Aaru.Images/CloneCD/Properties.cs b/Aaru.Images/CloneCD/Properties.cs index 633efd232..8376d4680 100644 --- a/Aaru.Images/CloneCD/Properties.cs +++ b/Aaru.Images/CloneCD/Properties.cs @@ -100,8 +100,7 @@ public sealed partial class CloneCd }; /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - new (string name, Type type, string description, object @default)[] - {}; + Array.Empty<(string name, Type type, string description, object @default)>(); /// public IEnumerable KnownExtensions => new[] { diff --git a/Aaru.Images/CopyTape/Properties.cs b/Aaru.Images/CopyTape/Properties.cs index c4d3c7f84..e0b9ced69 100644 --- a/Aaru.Images/CopyTape/Properties.cs +++ b/Aaru.Images/CopyTape/Properties.cs @@ -63,11 +63,9 @@ public sealed partial class CopyTape public bool IsTape { get; set; } /// - public IEnumerable SupportedMediaTags => new MediaTagType[] - {}; + public IEnumerable SupportedMediaTags => Array.Empty(); /// - public IEnumerable SupportedSectorTags => new SectorTagType[] - {}; + public IEnumerable SupportedSectorTags => Array.Empty(); /// public IEnumerable SupportedMediaTypes => new[] { @@ -98,8 +96,7 @@ public sealed partial class CopyTape }; /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - new (string name, Type type, string description, object @default)[] - {}; + Array.Empty<(string name, Type type, string description, object @default)>(); /// public IEnumerable KnownExtensions => new[] { diff --git a/Aaru.Images/DiskCopy42/Properties.cs b/Aaru.Images/DiskCopy42/Properties.cs index 4d0bd8b2e..8217f99e7 100644 --- a/Aaru.Images/DiskCopy42/Properties.cs +++ b/Aaru.Images/DiskCopy42/Properties.cs @@ -56,8 +56,7 @@ public sealed partial class DiskCopy42 /// public string Format => "Apple DiskCopy 4.2"; /// - public IEnumerable SupportedMediaTags => new MediaTagType[] - {}; + public IEnumerable SupportedMediaTags => Array.Empty(); /// public IEnumerable SupportedSectorTags => new[] { diff --git a/Aaru.Images/DriDiskCopy/Properties.cs b/Aaru.Images/DriDiskCopy/Properties.cs index 857df2250..623921d60 100644 --- a/Aaru.Images/DriDiskCopy/Properties.cs +++ b/Aaru.Images/DriDiskCopy/Properties.cs @@ -57,11 +57,9 @@ public sealed partial class DriDiskCopy /// public CICMMetadataType CicmMetadata => null; /// - public IEnumerable SupportedMediaTags => new MediaTagType[] - {}; + public IEnumerable SupportedMediaTags => Array.Empty(); /// - public IEnumerable SupportedSectorTags => new SectorTagType[] - {}; + public IEnumerable SupportedSectorTags => Array.Empty(); // TODO: Test with real hardware to see real supported media /// @@ -77,8 +75,7 @@ public sealed partial class DriDiskCopy }; /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - new (string name, Type type, string description, object @default)[] - {}; + Array.Empty<(string name, Type type, string description, object @default)>(); /// public IEnumerable KnownExtensions => new[] { diff --git a/Aaru.Images/MaxiDisk/Properties.cs b/Aaru.Images/MaxiDisk/Properties.cs index e082b05c5..e5ab3917c 100644 --- a/Aaru.Images/MaxiDisk/Properties.cs +++ b/Aaru.Images/MaxiDisk/Properties.cs @@ -56,11 +56,9 @@ public sealed partial class MaxiDisk /// public CICMMetadataType CicmMetadata => null; /// - public IEnumerable SupportedMediaTags => new MediaTagType[] - {}; + public IEnumerable SupportedMediaTags => Array.Empty(); /// - public IEnumerable SupportedSectorTags => new SectorTagType[] - {}; + public IEnumerable SupportedSectorTags => Array.Empty(); // TODO: Test with real hardware to see real supported media /// @@ -76,8 +74,7 @@ public sealed partial class MaxiDisk }; /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - new (string name, Type type, string description, object @default)[] - {}; + Array.Empty<(string name, Type type, string description, object @default)>(); /// public IEnumerable KnownExtensions => new[] { diff --git a/Aaru.Images/NHDr0/Properties.cs b/Aaru.Images/NHDr0/Properties.cs index 738bd8f7c..560335a1c 100644 --- a/Aaru.Images/NHDr0/Properties.cs +++ b/Aaru.Images/NHDr0/Properties.cs @@ -56,11 +56,9 @@ public sealed partial class Nhdr0 /// public CICMMetadataType CicmMetadata => null; /// - public IEnumerable SupportedMediaTags => new MediaTagType[] - {}; + public IEnumerable SupportedMediaTags => Array.Empty(); /// - public IEnumerable SupportedSectorTags => new SectorTagType[] - {}; + public IEnumerable SupportedSectorTags => Array.Empty(); /// public IEnumerable SupportedMediaTypes => new[] { @@ -70,8 +68,7 @@ public sealed partial class Nhdr0 // TODO: Support dynamic images /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - new (string name, Type type, string description, object @default)[] - {}; + Array.Empty<(string name, Type type, string description, object @default)>(); /// public IEnumerable KnownExtensions => new[] { diff --git a/Aaru.Images/Parallels/Properties.cs b/Aaru.Images/Parallels/Properties.cs index 8370ddc26..0a597b9cf 100644 --- a/Aaru.Images/Parallels/Properties.cs +++ b/Aaru.Images/Parallels/Properties.cs @@ -56,11 +56,9 @@ public sealed partial class Parallels /// public CICMMetadataType CicmMetadata => null; /// - public IEnumerable SupportedMediaTags => new MediaTagType[] - {}; + public IEnumerable SupportedMediaTags => Array.Empty(); /// - public IEnumerable SupportedSectorTags => new SectorTagType[] - {}; + public IEnumerable SupportedSectorTags => Array.Empty(); /// public IEnumerable SupportedMediaTypes => new[] { @@ -72,8 +70,7 @@ public sealed partial class Parallels // TODO: Add cluster size option /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - new (string name, Type type, string description, object @default)[] - {}; + Array.Empty<(string name, Type type, string description, object @default)>(); /// public IEnumerable KnownExtensions => new[] { diff --git a/Aaru.Images/QCOW/Properties.cs b/Aaru.Images/QCOW/Properties.cs index bc81177c6..e73cfad0d 100644 --- a/Aaru.Images/QCOW/Properties.cs +++ b/Aaru.Images/QCOW/Properties.cs @@ -57,11 +57,9 @@ public sealed partial class Qcow /// public CICMMetadataType CicmMetadata => null; /// - public IEnumerable SupportedMediaTags => new MediaTagType[] - {}; + public IEnumerable SupportedMediaTags => Array.Empty(); /// - public IEnumerable SupportedSectorTags => new SectorTagType[] - {}; + public IEnumerable SupportedSectorTags => Array.Empty(); /// public IEnumerable SupportedMediaTypes => new[] { @@ -71,8 +69,7 @@ public sealed partial class Qcow }; /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - new (string name, Type type, string description, object @default)[] - {}; + Array.Empty<(string name, Type type, string description, object @default)>(); /// public IEnumerable KnownExtensions => new[] { diff --git a/Aaru.Images/QCOW2/Properties.cs b/Aaru.Images/QCOW2/Properties.cs index d25132576..40b5ff3c9 100644 --- a/Aaru.Images/QCOW2/Properties.cs +++ b/Aaru.Images/QCOW2/Properties.cs @@ -57,11 +57,9 @@ public sealed partial class Qcow2 /// public CICMMetadataType CicmMetadata => null; /// - public IEnumerable SupportedMediaTags => new MediaTagType[] - {}; + public IEnumerable SupportedMediaTags => Array.Empty(); /// - public IEnumerable SupportedSectorTags => new SectorTagType[] - {}; + public IEnumerable SupportedSectorTags => Array.Empty(); /// public IEnumerable SupportedMediaTypes => new[] { @@ -71,8 +69,7 @@ public sealed partial class Qcow2 }; /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - new (string name, Type type, string description, object @default)[] - {}; + Array.Empty<(string name, Type type, string description, object @default)>(); /// public IEnumerable KnownExtensions => new[] { diff --git a/Aaru.Images/QED/Properties.cs b/Aaru.Images/QED/Properties.cs index 8f45cc844..e20ef9067 100644 --- a/Aaru.Images/QED/Properties.cs +++ b/Aaru.Images/QED/Properties.cs @@ -58,11 +58,9 @@ public sealed partial class Qed public CICMMetadataType CicmMetadata => null; /// - public IEnumerable SupportedMediaTags => new MediaTagType[] - {}; + public IEnumerable SupportedMediaTags => Array.Empty(); /// - public IEnumerable SupportedSectorTags => new SectorTagType[] - {}; + public IEnumerable SupportedSectorTags => Array.Empty(); /// public IEnumerable SupportedMediaTypes => new[] { @@ -74,8 +72,7 @@ public sealed partial class Qed // TODO: Add cluster size option /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - new (string name, Type type, string description, object @default)[] - {}; + Array.Empty<(string name, Type type, string description, object @default)>(); /// public IEnumerable KnownExtensions => new[] { diff --git a/Aaru.Images/RayDIM/Properties.cs b/Aaru.Images/RayDIM/Properties.cs index e189f673a..5781a5909 100644 --- a/Aaru.Images/RayDIM/Properties.cs +++ b/Aaru.Images/RayDIM/Properties.cs @@ -56,11 +56,9 @@ public sealed partial class RayDim /// public CICMMetadataType CicmMetadata => null; /// - public IEnumerable SupportedMediaTags => new MediaTagType[] - {}; + public IEnumerable SupportedMediaTags => Array.Empty(); /// - public IEnumerable SupportedSectorTags => new SectorTagType[] - {}; + public IEnumerable SupportedSectorTags => Array.Empty(); // TODO: Test with real hardware to see real supported media /// @@ -76,8 +74,7 @@ public sealed partial class RayDim }; /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - new (string name, Type type, string description, object @default)[] - {}; + Array.Empty<(string name, Type type, string description, object @default)>(); /// public IEnumerable KnownExtensions => new[] { diff --git a/Aaru.Images/RsIde/Properties.cs b/Aaru.Images/RsIde/Properties.cs index 2fa872e87..4e38f3608 100644 --- a/Aaru.Images/RsIde/Properties.cs +++ b/Aaru.Images/RsIde/Properties.cs @@ -61,8 +61,7 @@ public sealed partial class RsIde MediaTagType.ATA_IDENTIFY }; /// - public IEnumerable SupportedSectorTags => new SectorTagType[] - {}; + public IEnumerable SupportedSectorTags => Array.Empty(); /// public IEnumerable SupportedMediaTypes => new[] { @@ -72,8 +71,7 @@ public sealed partial class RsIde }; /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - new (string name, Type type, string description, object @default)[] - {}; + Array.Empty<(string name, Type type, string description, object @default)>(); /// public IEnumerable KnownExtensions => new[] { diff --git a/Aaru.Images/SaveDskF/Properties.cs b/Aaru.Images/SaveDskF/Properties.cs index 9da5c335c..428ef1b62 100644 --- a/Aaru.Images/SaveDskF/Properties.cs +++ b/Aaru.Images/SaveDskF/Properties.cs @@ -56,11 +56,9 @@ public sealed partial class SaveDskF /// public CICMMetadataType CicmMetadata => null; /// - public IEnumerable SupportedMediaTags => new MediaTagType[] - {}; + public IEnumerable SupportedMediaTags => Array.Empty(); /// - public IEnumerable SupportedSectorTags => new SectorTagType[] - {}; + public IEnumerable SupportedSectorTags => Array.Empty(); // TODO: Test with real hardware to see real supported media /// @@ -76,8 +74,7 @@ public sealed partial class SaveDskF }; /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - new (string name, Type type, string description, object @default)[] - {}; + Array.Empty<(string name, Type type, string description, object @default)>(); /// public IEnumerable KnownExtensions => new[] { diff --git a/Aaru.Images/T98/Properties.cs b/Aaru.Images/T98/Properties.cs index e2078c1f6..6f6037861 100644 --- a/Aaru.Images/T98/Properties.cs +++ b/Aaru.Images/T98/Properties.cs @@ -56,11 +56,9 @@ public sealed partial class T98 /// public CICMMetadataType CicmMetadata => null; /// - public IEnumerable SupportedMediaTags => new MediaTagType[] - {}; + public IEnumerable SupportedMediaTags => Array.Empty(); /// - public IEnumerable SupportedSectorTags => new SectorTagType[] - {}; + public IEnumerable SupportedSectorTags => Array.Empty(); /// public IEnumerable SupportedMediaTypes => new[] { @@ -70,8 +68,7 @@ public sealed partial class T98 }; /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - new (string name, Type type, string description, object @default)[] - {}; + Array.Empty<(string name, Type type, string description, object @default)>(); /// public IEnumerable KnownExtensions => new[] { diff --git a/Aaru.Images/UDIF/Properties.cs b/Aaru.Images/UDIF/Properties.cs index 0a3be582b..e391caaf7 100644 --- a/Aaru.Images/UDIF/Properties.cs +++ b/Aaru.Images/UDIF/Properties.cs @@ -57,11 +57,9 @@ public sealed partial class Udif /// public CICMMetadataType CicmMetadata => null; /// - public IEnumerable SupportedMediaTags => new MediaTagType[] - {}; + public IEnumerable SupportedMediaTags => Array.Empty(); /// - public IEnumerable SupportedSectorTags => new SectorTagType[] - {}; + public IEnumerable SupportedSectorTags => Array.Empty(); /// public IEnumerable SupportedMediaTypes => new[] { @@ -71,8 +69,7 @@ public sealed partial class Udif }; /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - new (string name, Type type, string description, object @default)[] - {}; + Array.Empty<(string name, Type type, string description, object @default)>(); /// public IEnumerable KnownExtensions => new[] { diff --git a/Aaru.Images/VDI/Properties.cs b/Aaru.Images/VDI/Properties.cs index 318322ecf..4d1bbd71c 100644 --- a/Aaru.Images/VDI/Properties.cs +++ b/Aaru.Images/VDI/Properties.cs @@ -57,11 +57,9 @@ public sealed partial class Vdi /// public CICMMetadataType CicmMetadata => null; /// - public IEnumerable SupportedMediaTags => new MediaTagType[] - {}; + public IEnumerable SupportedMediaTags => Array.Empty(); /// - public IEnumerable SupportedSectorTags => new SectorTagType[] - {}; + public IEnumerable SupportedSectorTags => Array.Empty(); /// public IEnumerable SupportedMediaTypes => new[] { @@ -73,8 +71,7 @@ public sealed partial class Vdi // TODO: Add cluster size option /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - new (string name, Type type, string description, object @default)[] - {}; + Array.Empty<(string name, Type type, string description, object @default)>(); /// public IEnumerable KnownExtensions => new[] { diff --git a/Aaru.Images/VHD/Properties.cs b/Aaru.Images/VHD/Properties.cs index 8d606451f..75a35de16 100644 --- a/Aaru.Images/VHD/Properties.cs +++ b/Aaru.Images/VHD/Properties.cs @@ -71,11 +71,9 @@ public sealed partial class Vhd /// public CICMMetadataType CicmMetadata => null; /// - public IEnumerable SupportedMediaTags => new MediaTagType[] - {}; + public IEnumerable SupportedMediaTags => Array.Empty(); /// - public IEnumerable SupportedSectorTags => new SectorTagType[] - {}; + public IEnumerable SupportedSectorTags => Array.Empty(); /// public IEnumerable SupportedMediaTypes => new[] { @@ -87,8 +85,7 @@ public sealed partial class Vhd // TODO: Support dynamic images /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - new (string name, Type type, string description, object @default)[] - {}; + Array.Empty<(string name, Type type, string description, object @default)>(); /// public IEnumerable KnownExtensions => new[] { diff --git a/Aaru.Images/VMware/Properties.cs b/Aaru.Images/VMware/Properties.cs index ccc70641f..d11d9f0d0 100644 --- a/Aaru.Images/VMware/Properties.cs +++ b/Aaru.Images/VMware/Properties.cs @@ -57,11 +57,9 @@ public sealed partial class VMware /// public CICMMetadataType CicmMetadata => null; /// - public IEnumerable SupportedMediaTags => new MediaTagType[] - {}; + public IEnumerable SupportedMediaTags => Array.Empty(); /// - public IEnumerable SupportedSectorTags => new SectorTagType[] - {}; + public IEnumerable SupportedSectorTags => Array.Empty(); /// public IEnumerable SupportedMediaTypes => new[] { diff --git a/Aaru.Images/Virtual98/Properties.cs b/Aaru.Images/Virtual98/Properties.cs index 79539982e..c5c2cf149 100644 --- a/Aaru.Images/Virtual98/Properties.cs +++ b/Aaru.Images/Virtual98/Properties.cs @@ -56,11 +56,9 @@ public sealed partial class Virtual98 /// public CICMMetadataType CicmMetadata => null; /// - public IEnumerable SupportedMediaTags => new MediaTagType[] - {}; + public IEnumerable SupportedMediaTags => Array.Empty(); /// - public IEnumerable SupportedSectorTags => new SectorTagType[] - {}; + public IEnumerable SupportedSectorTags => Array.Empty(); /// public IEnumerable SupportedMediaTypes => new[] { @@ -70,8 +68,7 @@ public sealed partial class Virtual98 }; /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - new (string name, Type type, string description, object @default)[] - {}; + Array.Empty<(string name, Type type, string description, object @default)>(); /// public IEnumerable KnownExtensions => new[] { diff --git a/Aaru.Images/ZZZRawImage/Properties.cs b/Aaru.Images/ZZZRawImage/Properties.cs index f49cc2c1f..e9237866c 100644 --- a/Aaru.Images/ZZZRawImage/Properties.cs +++ b/Aaru.Images/ZZZRawImage/Properties.cs @@ -173,8 +173,7 @@ public sealed partial class ZZZRawImage ToArray(); /// - public IEnumerable SupportedSectorTags => new SectorTagType[] - {}; + public IEnumerable SupportedSectorTags => Array.Empty(); /// public IEnumerable SupportedMediaTypes @@ -215,8 +214,7 @@ public sealed partial class ZZZRawImage /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => - new (string name, Type type, string description, object @default)[] - {}; + Array.Empty<(string name, Type type, string description, object @default)>(); /// public IEnumerable KnownExtensions => new[] { diff --git a/Aaru.Tests/Images/BlockMediaImageTest.cs b/Aaru.Tests/Images/BlockMediaImageTest.cs index 817a0dffe..93750451d 100644 --- a/Aaru.Tests/Images/BlockMediaImageTest.cs +++ b/Aaru.Tests/Images/BlockMediaImageTest.cs @@ -270,8 +270,7 @@ public abstract class BlockMediaImageTest : BaseMediaImageTest Assert.IsNotNull(plugin, "Could not instantiate filesystem plugin"); var fs = (IReadOnlyFilesystem)plugin.GetType().GetConstructor(Type.EmptyTypes)?. - Invoke(new object[] - {}); + Invoke(Array.Empty()); Assert.IsNotNull(fs, $"Could not instantiate filesystem {pluginName} in {testFile}"); diff --git a/Aaru.Tests/Issues/FsExtractHashIssueTest.cs b/Aaru.Tests/Issues/FsExtractHashIssueTest.cs index e6071d12c..f590f5c34 100644 --- a/Aaru.Tests/Issues/FsExtractHashIssueTest.cs +++ b/Aaru.Tests/Issues/FsExtractHashIssueTest.cs @@ -119,8 +119,7 @@ public abstract class FsExtractHashIssueTest Assert.IsNotNull(plugin, "Could not instantiate filesystem plugin"); - var fs = (IReadOnlyFilesystem)plugin.GetType().GetConstructor(Type.EmptyTypes)?.Invoke(new object[] - {}); + var fs = (IReadOnlyFilesystem)plugin.GetType().GetConstructor(Type.EmptyTypes)?.Invoke(Array.Empty()); Assert.IsNotNull(fs, $"Could not instantiate filesystem {pluginName}"); diff --git a/Aaru.Tests/Issues/FsExtractIssueTest.cs b/Aaru.Tests/Issues/FsExtractIssueTest.cs index c790464b0..4c464a4ae 100644 --- a/Aaru.Tests/Issues/FsExtractIssueTest.cs +++ b/Aaru.Tests/Issues/FsExtractIssueTest.cs @@ -85,8 +85,7 @@ public abstract class FsExtractIssueTest Assert.IsNotNull(plugin, "Could not instantiate filesystem plugin"); var fs = (IReadOnlyFilesystem)plugin.GetType().GetConstructor(Type.EmptyTypes)?. - Invoke(new object[] - {}); + Invoke(Array.Empty()); Assert.IsNotNull(fs, $"Could not instantiate filesystem {pluginName}"); @@ -106,8 +105,7 @@ public abstract class FsExtractIssueTest if(plugin is null) continue; - var fs = (IReadOnlyFilesystem)plugin.GetType().GetConstructor(Type.EmptyTypes)?.Invoke(new object[] - {}); + var fs = (IReadOnlyFilesystem)plugin.GetType().GetConstructor(Type.EmptyTypes)?.Invoke(Array.Empty()); Assert.IsNotNull(fs, $"Could not instantiate filesystem {plugin.Name}"); diff --git a/Aaru/Commands/Filesystem/ExtractFiles.cs b/Aaru/Commands/Filesystem/ExtractFiles.cs index 555578342..45d1aca36 100644 --- a/Aaru/Commands/Filesystem/ExtractFiles.cs +++ b/Aaru/Commands/Filesystem/ExtractFiles.cs @@ -335,8 +335,7 @@ sealed class ExtractFilesCommand : Command AaruConsole.WriteLine($"[bold]As identified by {plugin.Name}.[/]"); var fs = (IReadOnlyFilesystem)plugin.GetType().GetConstructor(Type.EmptyTypes)?. - Invoke(new object[] - {}); + Invoke(Array.Empty()); Spectre.ProgressSingleSpinner(ctx => { @@ -369,8 +368,7 @@ sealed class ExtractFilesCommand : Command AaruConsole.WriteLine($"[bold]Identified by {plugin.Name}.[/]"); var fs = (IReadOnlyFilesystem)plugin.GetType().GetConstructor(Type.EmptyTypes)?. - Invoke(new object[] - {}); + Invoke(Array.Empty()); Spectre.ProgressSingleSpinner(ctx => { diff --git a/Aaru/Commands/Filesystem/Ls.cs b/Aaru/Commands/Filesystem/Ls.cs index f371dbd4d..4559f883b 100644 --- a/Aaru/Commands/Filesystem/Ls.cs +++ b/Aaru/Commands/Filesystem/Ls.cs @@ -307,8 +307,7 @@ sealed class LsCommand : Command AaruConsole.WriteLine($"[bold]As identified by {plugin.Name}.[/]"); var fs = (IReadOnlyFilesystem)plugin.GetType().GetConstructor(Type.EmptyTypes)?. - Invoke(new object[] - {}); + Invoke(Array.Empty()); if(fs == null) continue; @@ -341,8 +340,7 @@ sealed class LsCommand : Command AaruConsole.WriteLine($"[bold]Identified by {plugin.Name}.[/]"); var fs = (IReadOnlyFilesystem)plugin.GetType().GetConstructor(Type.EmptyTypes)?. - Invoke(new object[] - {}); + Invoke(Array.Empty()); if(fs == null) continue;