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 a bug that would trigger infinite recursion in anyCharacter(in:) #8

Merged
merged 6 commits into from Feb 20, 2018

Conversation

kyouko-taiga
Copy link
Contributor

I found a bug that I introduced by removing references to character views. Because String.subscript now longer returns a character view, the function anyCharacter(in: String) would call itself.
I fixed it by creating an array that wraps the the substring.

If this raises concerns with respect to performances, I guess I could explicitly create a substring with suffix(from:) instead. That said I don't think this would change anything, as I believe the created array doesn't involve any copy of the original string.

@rxwei rxwei merged commit 32f6530 into rxwei:master Feb 20, 2018
@rxwei
Copy link
Owner

rxwei commented Feb 20, 2018

Thank you!

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.

None yet

2 participants