From de9a57a5c15f9ea6770d9afb7726c7d2656778da Mon Sep 17 00:00:00 2001 From: Sergei Pavlov Date: Wed, 3 Aug 2022 00:13:29 -0700 Subject: [PATCH] Shift instead of division --- src/libraries/System.Private.CoreLib/src/System/DateTime.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/DateTime.cs b/src/libraries/System.Private.CoreLib/src/System/DateTime.cs index 71928811ee3e0..52b338392ae65 100644 --- a/src/libraries/System.Private.CoreLib/src/System/DateTime.cs +++ b/src/libraries/System.Private.CoreLib/src/System/DateTime.cs @@ -1440,7 +1440,7 @@ public int Day // is an integer between 1 and 366. // public int DayOfYear => - 1 + ((((int)(UTicks / TicksPer6Hours) | 3) % DaysPer400Years) | 3) % DaysPer4Years / 4; + 1 + (((((int)(UTicks / TicksPer6Hours) | 3) % DaysPer400Years) | 3) % DaysPer4Years >> 2); // Returns the hash code for this DateTime. //