Remove unncessary nullability from sets

This commit is contained in:
Matt Nadareski
2024-11-25 11:13:52 -05:00
parent c96185d550
commit e4d9848756
3 changed files with 12 additions and 12 deletions

View File

@@ -9,10 +9,10 @@ namespace SabreTools.Matching.Content
public class ContentMatchSet : IMatchSet<ContentMatch, byte?[]>
{
/// <inheritdoc/>
public List<ContentMatch>? Matchers { get; }
public List<ContentMatch> Matchers { get; }
/// <inheritdoc/>
public string? SetName { get; }
public string SetName { get; }
/// <summary>
/// Function to get a content version
@@ -139,7 +139,7 @@ namespace SabreTools.Matching.Content
public List<int> MatchesAll(byte[]? stack)
{
// If either array is null or empty, we can't do anything
if (stack == null || stack.Length == 0 || Matchers == null || Matchers.Count == 0)
if (stack == null || stack.Length == 0 || Matchers.Count == 0)
return [];
// Initialize the position list
@@ -166,7 +166,7 @@ namespace SabreTools.Matching.Content
public int MatchesAny(byte[]? stack)
{
// If either array is null or empty, we can't do anything
if (stack == null || stack.Length == 0 || Matchers == null || Matchers.Count == 0)
if (stack == null || stack.Length == 0 || Matchers.Count == 0)
return -1;
// Loop through all content matches and make sure all pass
@@ -192,7 +192,7 @@ namespace SabreTools.Matching.Content
public List<int> MatchesAll(Stream? stack)
{
// If either array is null or empty, we can't do anything
if (stack == null || stack.Length == 0 || Matchers == null || Matchers.Count == 0)
if (stack == null || stack.Length == 0 || Matchers.Count == 0)
return [];
// Initialize the position list
@@ -219,7 +219,7 @@ namespace SabreTools.Matching.Content
public int MatchesAny(Stream? stack)
{
// If either array is null or empty, we can't do anything
if (stack == null || stack.Length == 0 || Matchers == null || Matchers.Count == 0)
if (stack == null || stack.Length == 0 || Matchers.Count == 0)
return -1;
// Loop through all content matches and make sure all pass

View File

@@ -10,11 +10,11 @@ namespace SabreTools.Matching
/// <summary>
/// Set of all matchers
/// </summary>
public List<T>? Matchers { get; }
public List<T> Matchers { get; }
/// <summary>
/// Unique name for the match set
/// </summary>
public string? SetName { get; }
public string SetName { get; }
}
}

View File

@@ -9,10 +9,10 @@ namespace SabreTools.Matching.Paths
public class PathMatchSet : IMatchSet<PathMatch, string>
{
/// <inheritdoc/>
public List<PathMatch>? Matchers { get; }
public List<PathMatch> Matchers { get; }
/// <inheritdoc/>
public string? SetName { get; }
public string SetName { get; }
/// <summary>
/// Function to get a path version for this Matcher
@@ -101,7 +101,7 @@ namespace SabreTools.Matching.Paths
public List<string> MatchesAll(List<string>? stack)
{
// If either set is null or empty, we can't do anything
if (stack == null || stack.Count == 0 || Matchers == null || Matchers.Count == 0)
if (stack == null || stack.Count == 0 || Matchers.Count == 0)
return [];
// Initialize the value list
@@ -136,7 +136,7 @@ namespace SabreTools.Matching.Paths
public string? MatchesAny(List<string>? stack)
{
// If either set is null or empty, we can't do anything
if (stack == null || stack.Count == 0 || Matchers == null || Matchers.Count == 0)
if (stack == null || stack.Count == 0 || Matchers.Count == 0)
return null;
// Loop through all path matches and make sure all pass