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 array indexing with empty string #660

Merged
merged 1 commit into from Sep 11, 2019

Conversation

lahma
Copy link
Collaborator

@lahma lahma commented Sep 3, 2019

fixes #659

{
return uint.MaxValue;
}

int d = p[0] - '0';
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm sorry to interfere, but why not use char.IsDigit(p[0]) here? I checked the performance of both approaches - they are identical.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well we need the actual value, say 5 to return and then when we detect length being more than 1 when start addition to that value.

@sebastienros sebastienros merged commit 6a01501 into sebastienros:dev Sep 11, 2019
@lahma lahma deleted the bugs/empty-array-index branch September 12, 2019 03:49
ruixiao-yu pushed a commit to cyclr/jint that referenced this pull request Feb 13, 2020
ruixiao-yu added a commit to cyclr/jint that referenced this pull request Feb 19, 2020
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.

IndexOutOfRangeException occurs when try to acces the array item by empty string
3 participants