From 6425b2d1c2568b115a7a2b5cd130d85ec4f53a84 Mon Sep 17 00:00:00 2001 From: ts2do Date: Mon, 6 Jan 2020 15:57:32 -0600 Subject: [PATCH] Copy change to XsdDateTime (#1319) I copied the change from dotnet/coreclr#7769 to XsdDateTime which eliminates extraneous iterations of the days array. --- src/libraries/System.Private.Xml/src/System/Xml/Schema/XsdDateTime.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/XsdDateTime.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/XsdDateTime.cs index 2707825..82d2b5d 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/XsdDateTime.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/XsdDateTime.cs @@ -612,7 +612,7 @@ namespace System.Xml.Schema 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++; -- 2.7.4