Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid invoking Match twice in FindIndex and allow fetching index directly from Matcher #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cskr
Copy link

@cskr cskr commented Jul 31, 2014

Creating a Matcher performs the match automatically and hence Matches() can be used to check success at a much lower cost.

Also, using FindIndex on a long stream will create a new Matches for each match. The second change helps avoid this and that also avoids an additional CGO call.

cskr added 2 commits July 31, 2014 20:39
Creating a Matcher performs the match automatically and hence Matches()
can be used to check success at a much lower cost.
This can help avoid creating new Matcher for each match in long stream
of bytes.
@cskr cskr changed the title Avoid invoking Match twice in FindIndex Avoid invoking Match twice in FindIndex and allow fetching index directly from Matcher Jul 31, 2014
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.

1 participant