Skip to content

Conversation

@driv
Copy link
Owner

@driv driv commented Sep 22, 2025

No description provided.

driv added 7 commits September 6, 2025 17:30
This commit optimizes the pattern matching by adding a fast path for the `hardLiteral`.
If the `hardLiteral` (the longest literal in the pattern) is not found in the input, the pattern matching is skipped.
This avoids unnecessary calls to `bytes.Index` and improves the performance of the `Test` function.
This commit renames the `hardLiteral` field to `longestLiteral` to better
reflect its purpose. This field holds the longest literal in the pattern
and is used to quickly discard non-matching lines.
@driv driv merged commit d57e6b2 into main Sep 22, 2025
4 checks passed
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.

2 participants