Enable nullability everywhere

This commit is contained in:
Matt Nadareski
2024-02-28 19:19:50 -05:00
parent 11d024bd16
commit 823a9ca7b7
145 changed files with 1545 additions and 1260 deletions

View File

@@ -14,7 +14,7 @@ namespace SabreTools.Core.Tools
/// </summary>
public static List<DatItemField> AsDatItemFields(this Hash hash)
{
List<DatItemField> fields = new();
List<DatItemField> fields = [];
if (hash.HasFlag(Hash.CRC))
fields.Add(DatItemField.CRC);
@@ -348,7 +348,7 @@ namespace SabreTools.Core.Tools
var values = Enum.GetValues(typeof(T));
// Build the output dictionary
Dictionary<string, T> mappings = new();
Dictionary<string, T> mappings = [];
foreach (T value in values)
{
// Try to get the mapping attribute
@@ -370,7 +370,7 @@ namespace SabreTools.Core.Tools
catch
{
// This should not happen, only if the type was not an enum
return new Dictionary<string, T>();
return [];
}
}
@@ -592,7 +592,7 @@ namespace SabreTools.Core.Tools
var values = Enum.GetValues(typeof(T));
// Build the output dictionary
Dictionary<T, string> mappings = new();
Dictionary<T, string> mappings = [];
foreach (T value in values)
{
// Try to get the mapping attribute
@@ -613,7 +613,7 @@ namespace SabreTools.Core.Tools
catch
{
// This should not happen, only if the type was not an enum
return new Dictionary<T, string>();
return [];
}
}