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

Remove unnecessary regex #26

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

Conversation

CharlesC87
Copy link

I replace regex by charcter matching or string_view manipulation.
As we are not c++17 yet in the repo, I added a light version string_view to allow to work with it.

Next commit will be on the parser part with change for regex to speed-up find of correct regex

Copy link
Owner

@ibc ibc left a comment

Choose a reason for hiding this comment

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

Thanks. Not sure when we'll be able to review this but will do.

src/writer.cpp Outdated Show resolved Hide resolved
@CharlesC87
Copy link
Author

New commit with formatting fix and changes to parser
basically the idea is to avoid regex when possible : in particular when doing the match for attributes (a=) most of teh regex have a prefix of the form ("^name:").
Now we do a string search of "name:" and if not, we avoid a regex match.
If the name is found, we try to match regex on the rest

@CharlesC87 CharlesC87 force-pushed the feature/remove_unnecesary_regex branch from 8e5d09e to b29acd7 Compare February 13, 2023 15:43
@CharlesC87 CharlesC87 requested a review from ibc February 14, 2023 08:47
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