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

perf: Optimize number parse logics #1007

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

Conversation

filzrev
Copy link
Contributor

@filzrev filzrev commented Nov 10, 2024

This PR intended to fix following issues.

1. Change number checks to more strict regex
It's discussed at #990 (comment)
When parsing scalar values. whitespaces are already ignored by scanner.
So there is no needs using partial regex match.

2. Change Hex string format parse logics not to throw exceptions
Same as integer/float string format. (That is fixed at #990)

[InlineData(System.Int32.MinValue)]
[InlineData(System.Int32.MaxValue)]
[InlineData(System.Int64.MinValue)]
[InlineData(System.Int64.MaxValue)]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

UnitTest for ulong is not included.
Because ulong code path is not seems not be used.
Hex/Octal number representation is same for long/ulong and these number is always parsed as long

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