mirror of
https://github.com/SabreTools/SabreTools.Matching.git
synced 2026-09-24 07:44:03 +00:00
Fix missed standard byte variant
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user