Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Do not run TryParseExact on null dates #678

Merged
merged 4 commits into from
Aug 3, 2016
Merged

Do not run TryParseExact on null dates #678

merged 4 commits into from
Aug 3, 2016

Conversation

pakrym
Copy link
Contributor

@pakrym pakrym commented Aug 2, 2016

Before

http://i.imgur.com/tBQSFtB.png

After

http://i.imgur.com/MlU9c7K.png

@davidfowl @Tratcher

@pakrym pakrym force-pushed the pakrym/fast-date branch from a25b911 to 139976e Compare August 2, 2016 22:07
@pakrym pakrym closed this Aug 2, 2016
@@ -241,6 +241,11 @@ internal static string DateToString(DateTimeOffset dateTime)

internal static bool TryStringToDate(string input, out DateTimeOffset result)
{
if (input == null)
Copy link
Contributor

@pranavkm pranavkm Aug 2, 2016

Choose a reason for hiding this comment

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

Does this help to add a check for empty strings or is that not a common occurrence?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It usually not. This is for the case when header is absent.

@Tratcher
Copy link
Member

Tratcher commented Aug 2, 2016

:shipit:

@pakrym
Copy link
Contributor Author

pakrym commented Aug 2, 2016

After null short-circuit

http://i.imgur.com/ADALzcc.png

@davidfowl
Copy link
Member

🚢 🇮🇹

@pakrym pakrym merged commit e320755 into dev Aug 3, 2016
jkotalik pushed a commit that referenced this pull request Aug 3, 2016
jkotalik pushed a commit that referenced this pull request Aug 4, 2016
jkotalik pushed a commit that referenced this pull request Aug 4, 2016
@JunTaoLuo JunTaoLuo deleted the pakrym/fast-date branch January 6, 2017 22:01
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.

5 participants