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

Replace regex in trie diff main #758

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

Conversation

sergerad
Copy link
Contributor

@sergerad sergerad commented Oct 29, 2024

Closes #721

Replaces existing regex usage with macro from lazy_regex crate.

Improves the code by replacing slice indexing with &str tuple of the captured values.

Also avoids the regex being compiled in every iteration of the relevant for loop.

@github-actions github-actions bot added the crate: zero_bin Anything related to the zero-bin subcrates. label Oct 29, 2024
@sergerad
Copy link
Contributor Author

@0xaatif I couldn't find any e2e tests for the modified main.rs. I wrote a unit test to validate the regex capture behaviour but have not committed it because it was basically unit testing the lazy_regex crate. LMK if you have any suggestions around testing 🙏

Copy link
Contributor

@0xaatif 0xaatif left a comment

Choose a reason for hiding this comment

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

Looking good :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crate: zero_bin Anything related to the zero-bin subcrates.
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Don't compile a regex in a loop in trie_diff
3 participants