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

Make next behave like nextind for String #24423

Closed
wants to merge 1 commit into from

Conversation

bkamins
Copy link
Member

@bkamins bkamins commented Oct 31, 2017

Here is an example implementation of #24420 so that we can have a look what overhead it creates. Basically it adds one is_valid_continuation check at each iteration.

@andreasnoack
Copy link
Member

Would be great to avoid throwing at all, i.e. also return '\ufffd' if the first byte is not a valid continuation.

@bkamins
Copy link
Member Author

bkamins commented Oct 31, 2017

I am putting this on hold given @StefanKarpinski comment in #24420 is resolved (as this PR would be redundant then).

@inbounds for j = 1:(trailing + 1)
for j in (i+1):l
@inbounds if !is_valid_continuation(codeunit(s, j))
return '\ufffd' j
Copy link

@Liso77 Liso77 Oct 31, 2017

Choose a reason for hiding this comment

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

comma is missing here? return '\ufffd', j

Copy link
Member Author

Choose a reason for hiding this comment

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

thank you for the catch! I will fix it is decided that this should be merged (for now I feel that the proposal of @StefanKarpinski in #24420 will make it redundant).

@nalimilan nalimilan added the domain:strings "Strings!" label Nov 5, 2017
@bkamins
Copy link
Member Author

bkamins commented Dec 20, 2017

closing as outdated by #24439.

@bkamins bkamins closed this Dec 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:strings "Strings!"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants