Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,7 @@ public int ToFourDigitYear(int year, int twoDigitYearMax)

if (year < 100)
{
int y = year % 100;
return (twoDigitYearMax / 100 - (y > twoDigitYearMax % 100 ? 1 : 0)) * 100 + y;
return (twoDigitYearMax / 100 - (year > twoDigitYearMax % 100 ? 1 : 0)) * 100 + year;
}

if (year < m_minYear || year > m_maxYear)
Expand All @@ -543,6 +542,7 @@ public int ToFourDigitYear(int year, int twoDigitYearMax)
nameof(year),
SR.Format(SR.ArgumentOutOfRange_Range, m_minYear, m_maxYear));
}

// If the year value is above 100, just return the year value. Don't have to do
// the TwoDigitYearMax comparison.
return year;
Expand Down