1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-20 08:58:00 +02:00

Fixed operator precedence issues

This commit is contained in:
Brian Fiete 2020-10-07 07:47:08 -07:00
parent d0c9145655
commit 2ac478509e
7 changed files with 16 additions and 10 deletions

View file

@ -220,7 +220,8 @@ namespace System.Globalization {
int[] days = leapYear? DaysToMonth366: DaysToMonth365;
// All months have less than 32 days, so n >> 5 is a good conservative
// estimate for the month
int m = n >> 5 + 1;
//BCF- Note, the original read `int32 m = n >> 5 + 1;`, which may have been a bug. Preserving original precedence.
int m = n >> (5 + 1);
// m = 1-based month number
while (n >= days[m]) m++;
// If month was requested, return it