Skip to content

Commit

Permalink
Copy change to XsdDateTime (#1319)
Browse files Browse the repository at this point in the history
I copied the change from dotnet/coreclr#7769 to XsdDateTime which eliminates extraneous iterations of the days array.
  • Loading branch information
ts2do authored and stephentoub committed Jan 6, 2020
1 parent 3ad3b6f commit 6425b2d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ private void GetYearMonthDay(out int year, out int month, out int day)
int[] days = leapYear ? DaysToMonth366 : DaysToMonth365;
// All months have less than 32 days, so n >> 5 is a good conservative
// estimate for the month
month = n >> 5 + 1;
month = (n >> 5) + 1;
// m = 1-based month number
while (n >= days[month])
month++;
Expand Down

0 comments on commit 6425b2d

Please sign in to comment.