Skip to content

Conversation

@gurgunday
Copy link
Member

Forgot this one

Since we've now established that:

  • The lookbehind length is at max needleLength - 1, we have in the beginning pos = -lookbehind_size >= -(needleLength - 1)
  • And since we start by checking the last character, that last char will always be in data as pos + needleLength - 1 >= 0, and pos values equal to and larger than 0 correspond to the incoming data rather than the lookbehind, so we can safely remove the method

In short, ch will always be in data

@gurgunday gurgunday requested review from a team, climba03003 and zekth December 4, 2024 11:33
Copy link
Member

@zekth zekth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✌️

@gurgunday gurgunday merged commit fb4d05a into master Dec 10, 2024
13 checks passed
@gurgunday gurgunday deleted the lookup branch December 10, 2024 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants