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

Fix bug of not quoting keys with slashes etc #31

Closed
wants to merge 1 commit into from

Conversation

ThatCoolCoder
Copy link

I believe this fixes #30, although I haven't written tests for the new behavior (I couldn't figure out where would be most appropriate) and it probably needs a little bit of looking at.

I'm not sure why it's showing the additions of the IEnumerator stuff since the commit history shows that it was already in the code as of 729f57b, which was what I forked from.

@SamboyCoding
Copy link
Owner

SamboyCoding commented Jun 26, 2023

This is going to need a little more thought on my part, regexes often aren't the most performant things, and I've managed to avoid them so far.

@ThatCoolCoder
Copy link
Author

Ok, that's fair enough - I haven't tested the performance of this but I figured that a regex would have less of a performance impact than some sort of linq-based thing checking each character individually.

@SamboyCoding
Copy link
Owner

It does vary, for certain kinds of operations, especially on .net 7, linq can be very fast thanks to hardware acceleration (vector instructions). And helper functions like char.IsDigit etc exist. Also, might be able to optimize more if we can use ReadOnlySpan, as that has some further optimizations sometimes. I'll try to take a look this week some time to find the optimal solution - at the very least if we were going with regex I'd want RegexOptions.Compiled or on net7 a source-generated regex.

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.

Keys with symbols aren't quoted but they should be
2 participants