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

Implements bracket-balance checks and parse speed improvements. #10

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

Conversation

ZackPierce
Copy link

I saw the lone "FIXME" comment and could not resist trying to help.

The approach I ended up using is a direct search through the input string rather than a more complicated regular expression. ParseHex is now several times faster as a result, and no longer requires the extra array creation and copy that was caused by hex.DecodeString.

Using a directly-coded search has also allowed the error messages to become slightly more descriptive.

Tests have been added to confirm the functionality.

… when parsing strings. Direct text scanning approach also significantly improves parse speed and removes an unnecessary array allocation and copy.
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