0xPolygonZero / zk_evm

Apache License 2.0
85 stars 37 forks source link

Replace regex in trie diff main #758

Closed sergerad closed 2 weeks ago

sergerad commented 2 weeks ago

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.

sergerad commented 2 weeks ago

@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 🙏