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

Rework Tokenizer #254

Merged
merged 1 commit into from
May 8, 2024
Merged

Conversation

TheConstructor
Copy link
Contributor

I reworked Tokenizer, trying to remove the repeated splitting, as the elements were all already there and utilizing the built-in StringSplitOptions.RemoveEmptyEntries.

In doing this I found, that the current implementation would return a string twice, if it does not contain delimiters and the tokenizer is asked to return the delimiters. This is cause by Tokenize() not returning or setting tempstr to empty after if (tempstr.IndexOfAny(_delimiters.ToCharArray()) < 0 && tempstr.Length > 0), so that it is added again by the last if in that method.

@TheConstructor TheConstructor force-pushed the feature/sane-tokenizer branch from 0648250 to fc159ca Compare May 5, 2024 21:18
@dsbenghe dsbenghe merged commit 5ff61fa into dsbenghe:master May 8, 2024
16 checks passed
@TheConstructor TheConstructor deleted the feature/sane-tokenizer branch May 8, 2024 22:09
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.

2 participants