Fix missed standard byte variant

This commit is contained in:
Matt Nadareski
2024-11-21 10:06:22 -05:00
parent c7633b1a53
commit a180499090

View File

@@ -14,6 +14,19 @@ namespace SabreTools.Matching
return array == null || array.Length == 0;
}
/// <summary>
/// Find all positions of one array in another, if possible, if possible
/// </summary>
public static List<int> FindAllPositions(this byte[] stack, byte[]? needle, int start = 0, int end = -1)
{
// Convert the needle to a nullable byte array
byte?[]? nullableNeedle = null;
if (needle != null)
nullableNeedle = Array.ConvertAll(needle, b => (byte?)b);
return FindAllPositions(stack, nullableNeedle, start, end);
}
/// <summary>
/// Find all positions of one array in another, if possible, if possible
/// </summary>