Skip to content

Commit

Permalink
Merge pull request #134 from hollow87/master
Browse files Browse the repository at this point in the history
FindPattern speed increase
  • Loading branch information
erfg12 authored Feb 20, 2022
2 parents 8628ab6 + 46b28d1 commit f1bf950
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Memory/Methods/AoB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ private unsafe int FindPattern(byte* body, int bodyLength, byte[] pattern, byte[
if (((body[index] & masks[0]) == (pattern[0] & masks[0])))
{
var match = true;
for (int index2 = 1; index2 <= pattern.Length - 1; index2++)
for (int index2 = pattern.Length - 1; index2 >= 1; index2--)
{
if ((body[index + index2] & masks[index2]) == (pattern[index2] & masks[index2])) continue;
match = false;
Expand Down

0 comments on commit f1bf950

Please sign in to comment.