Skip to content
This repository was archived by the owner on Aug 1, 2024. It is now read-only.

Conversation

vadimm
Copy link

@vadimm vadimm commented Jan 16, 2020

No description provided.

else
{
return long.Parse(temp, NumberStyles.None, CultureInfo.InvariantCulture);
return Math.Max(0, long.Parse(temp, NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture));
Copy link
Member

Choose a reason for hiding this comment

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

Why don't we want to allow negative longs here?

Couldn't we do

return long.Parse(temp, NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture);

Choose a reason for hiding this comment

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

Yes, this should also work. The only reason to avoid negatives is that previously the framework would throw an exception, so it might be a breaking change for customer.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants